source: /cluster/svnroot/bccd-ng/branches/skylar/bccd-3.4.0-build_ng/Makefile @ 5922

Last change on this file since 5922 was 5922, checked in by skylar, 4 years ago

copy bccd-revision into deb build directory re #994

  • Property svn:keywords set to Id
File size: 2.9 KB
Line 
1# $Id: Makefile 5922 2017-03-19 22:36:04Z skylar $
2
3SHELL                           =       /bin/bash
4export MKDIR_P          :=      mkdir -p
5export SVNROOT          :=      https://cluster.earlham.edu/svn/bccd-ng/branches/skylar/bccd-3.4.0-build_ng
6export SVN_REV          =       $(shell svn info $(SVNROOT)|awk '$$1 ~ /^Revision:/ {print $$2}')
7export SVN_CO           :=      svn cat -r
8export VERSION          :=      3.4.0
9export KERN_REV         :=      4.0.0bccd
10
11.PHONY: install-iso
12
13# Archive this in Jenkins so that downstream projects have the correct ordering b/w target/bccd.noarch.deb and build/etc/bccd-revision
14build/etc/bccd-revision:
15        /bin/mkdir -p "$(WORKSPACE)"/build/etc
16        @echo "$(VERSION).$(SVN_REVISION)" > "$(WORKSPACE)"/build/etc/bccd-revision
17
18target/bccd.noarch.deb: build/etc/bccd-revision
19        cp $< "$(WORKSPACE)/src/etc"
20        fpm \
21                -n bccd \
22                -C "$(WORKSPACE)"/src \
23                -s dir \
24                -t deb \
25                -p "$(WORKSPACE)"/target/bccd.noarch.deb \
26                -v "$(VERSION)" \
27                --iteration "$(SVN_REVISION)" \
28                -x '*/.svn*' \
29                --before-install "$(WORKSPACE)/bin/deb/bccd_deb_before_install" \
30                --after-remove "$(WORKSPACE)/bin/deb/bccd_deb_after_remove" \
31                --after-install "$(WORKSPACE)/bin/deb/bccd_deb_after_install"
32
33debootstrap:
34        # Script will either create a new debootstrap (if executing a debootstrap project) or extract the imported
35        # debootstrap.tar.bz2 artifact
36        "$(WORKSPACE)"/bin/prepare_debootstrap
37
38target/debootstrap-bccd.tar.bz2: target/bccd.noarch.deb debootstrap
39        /bin/cp -v "$<" "$(WORKSPACE)/debootstrap/tmp"
40        "$(WORKSPACE)/bin/bccd_install_pkgs"
41        # Using pbzip2 takes a couple minutes but saves 50% / 2+GB of space
42        /bin/tar -C "$(WORKSPACE)" -cf - debootstrap | nice /usr/bin/pbzip2 -c > "$(@)"
43
44target/debootstrap.tar.bz2: debootstrap
45        /bin/tar -C "$(WORKSPACE)" -cf - "$<" | nice /usr/bin/pbzip2 -c > "$(@)"
46
47iso/live/initrd.img: debootstrap
48        /usr/bin/sudo /usr/sbin/chroot "$(WORKSPACE)/debootstrap" mkinitramfs \
49                -o "/boot/initrd-$(KERN_REV).diskless" "$(KERN_REV)"
50        /bin/cp "$(WORKSPACE)/debootstrap/boot/initrd-$(KERN_REV).diskless" "$(WORKSPACE)/$@"
51
52iso/live/vmlinuz: debootstrap
53        /bin/cp "$(WORKSPACE)/debootstrap/boot/vmlinuz-$(KERN_REV)" "$(WORKSPACE)/$@"
54
55iso/live/filesystem.squashfs: target/debootstrap-bccd.tar.bz2
56        nice /usr/bin/pbzip2 \
57                -dc "$<" \
58                | /bin/tar \
59                        -C "$(WORKSPACE)" \
60                        -xf -
61        nice /usr/local/bin/mksquashfs \
62                "debootstrap" \
63                "$@" \
64                -comp xz
65
66target/bccd.amd64.iso: iso/live/filesystem.squashfs iso/live/initrd.img iso/live/vmlinuz
67        nice /usr/bin/genisoimage \
68                -pad \
69                -l \
70                -r \
71                -J \
72                -v \
73                -V "BCCDv3-$(SVN_REV)" \
74                -no-emul-boot \
75                -boot-load-size 4 \
76                -boot-info-table \
77                -b boot/isolinux/isolinux.bin \
78                -c boot/isolinux/boot.cat \
79                -hide-rr-moved \
80                -o $@ \
81                iso
82
83target/bccd.amd64.iso.md5: target/bccd.amd64.iso
84# Change directory to make md5sum print just the filename
85        cd $(dir $<) && md5sum $(notdir $<) > $(notdir $@)
86
87install-iso: target/bccd.amd64.iso.md5
88# Copy the MD5 file target, and the associaetd ISO file, to ISO_INSTALL_DIR
89ifdef ISO_INSTALL_DIR
90        /bin/cp -v "$<" $(<:.md5=) "$(ISO_INSTALL_DIR)"
91endif
Note: See TracBrowser for help on using the repository browser.