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

Last change on this file was 6102, checked in by skylar, 2 years ago

rollback, jenkins error re #915

  • Property svn:keywords set to Id
File size: 4.8 KB
Line 
1# $Id: Makefile 6102 2018-10-23 16:35:57Z 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
9# KERN_REV needs to be set to a version supported by aufs (see /usr/src/aufs-xxx/dkms.conf)
10export KERN_REV         :=      4.16.0-2-amd64
11
12.PHONY: install-iso
13
14# Archive this in Jenkins so that downstream projects have the correct ordering b/w target/bccd.noarch.deb and build/etc/bccd-revision
15build/etc/bccd-revision:
16        /bin/mkdir -p "$(WORKSPACE)"/build/etc
17        @echo "$(VERSION).$(SVN_REVISION)" > "$(WORKSPACE)"/build/etc/bccd-revision
18        # Set modification time of bccd-revision to bccd.noarch.deb if it is available, to avoid
19        # unnecessary rebuild of bccd.noarch.deb if it is copied in from another build
20        find "$(WORKSPACE)"/target -type f -name bccd.noarch.deb -exec touch -r "{}" "$@" \;
21
22target/bccd.noarch.deb: build/etc/bccd-revision
23        cp $< "$(WORKSPACE)/src/etc"
24        # Dependency on gnupg2 is required by apt-key
25        fpm \
26                -n bccd \
27                -C "$(WORKSPACE)"/src \
28                -s dir \
29                -t deb \
30                -d gnupg2 \
31                -p "$(WORKSPACE)"/target/bccd.noarch.deb \
32                -v "$(VERSION)" \
33                --iteration "$(SVN_REVISION)" \
34                -x '*/.svn*' \
35                --before-install "$(WORKSPACE)/bin/deb/bccd_deb_before_install" \
36                --after-remove "$(WORKSPACE)/bin/deb/bccd_deb_after_remove" \
37                --after-install "$(WORKSPACE)/bin/deb/bccd_deb_after_install"
38
39debootstrap:
40        # Script will either create a new debootstrap (if executing a debootstrap project) or extract the imported
41        # debootstrap.tar.bz2 artifact
42        "$(WORKSPACE)"/bin/prepare_debootstrap
43
44target/debootstrap-bccd.tar.bz2: target/bccd.noarch.deb debootstrap
45        /bin/cp -v "$<" "$(WORKSPACE)/debootstrap/tmp"
46        "$(WORKSPACE)/bin/bccd_install_pkgs"
47        # Using pbzip2 takes a couple minutes but saves 50% / 2+GB of space
48        /bin/tar -C "$(WORKSPACE)" --exclude='debootstrap/proc/*' --exclude='debootstrap/sys/*' -cf - debootstrap | nice /usr/bin/pbzip2 -c > "$(@)"
49        /bin/rm --one-file-system -rf "$(WORKSPACE)/debootstrap"
50
51target/debootstrap.tar.bz2: debootstrap
52        /bin/tar -C "$(WORKSPACE)" --exclude="$<"'/proc/*' --exclude="$<"'/sys/*' -cf - "$<" | nice /usr/bin/pbzip2 -c > "$(@)"
53        /bin/rm --one-file-system -rf "$(WORKSPACE)/$<"
54
55iso/live/initrd.img: debootstrap
56        /usr/bin/sudo /usr/sbin/chroot "$(WORKSPACE)/debootstrap" mkinitramfs \
57                -o "/boot/initrd-$(KERN_REV).diskless" "$(KERN_REV)"
58        /bin/cp "$(WORKSPACE)/debootstrap/boot/initrd-$(KERN_REV).diskless" "$(WORKSPACE)/$@"
59
60iso/live/vmlinuz: debootstrap
61        /bin/cp "$(WORKSPACE)/debootstrap/boot/vmlinuz-$(KERN_REV)" "$(WORKSPACE)/$@"
62
63iso/live/filesystem.squashfs: target/debootstrap-bccd.tar.bz2
64        nice "$(WORKSPACE)"/bin/make_filesystem_squashfs -o "$@" < "$<"
65
66# Added to test ISO w/o bccd deb #1008
67nobccd-filesystem.squashfs: target/debootstrap.tar.bz2
68        "$(WORKSPACE)/bin/bccd_install_pkgs"
69        nice "$(WORKSPACE)"/bin/make_filesystem_squashfs -o iso/live/filesystem.squashfs < "$<"
70
71iso/boot/isolinux/isolinux.bin:
72        cp /usr/lib/ISOLINUX/isolinux.bin $@
73
74iso/boot/isolinux/ldlinux.c32:
75        cp /usr/lib/syslinux/modules/bios/ldlinux.c32 $@
76
77target/bccd.amd64.iso: iso/boot/isolinux/isolinux.bin iso/boot/isolinux/ldlinux.c32 iso/live/filesystem.squashfs iso/live/initrd.img iso/live/vmlinuz
78        nice /usr/bin/genisoimage \
79                -pad \
80                -l \
81                -r \
82                -J \
83                -v \
84                -V "BCCDv3-$(SVN_REV)" \
85                -no-emul-boot \
86                -boot-load-size 4 \
87                -boot-info-table \
88                -b boot/isolinux/isolinux.bin \
89                -c boot/isolinux/boot.cat \
90                -hide-rr-moved \
91                -o $@ \
92                iso
93        /bin/rm -rf --one-file-system "$(WORKSPACE)/iso"
94
95target/nobccd.amd64.iso: iso/boot/isolinux/isolinux.bin iso/boot/isolinux/ldlinux.c32 nobccd-filesystem.squashfs iso/live/initrd.img iso/live/vmlinuz
96        nice /usr/bin/genisoimage \
97                -pad \
98                -l \
99                -r \
100                -J \
101                -v \
102                -V "BCCDv3-$(SVN_REV)" \
103                -no-emul-boot \
104                -boot-load-size 4 \
105                -boot-info-table \
106                -b boot/isolinux/isolinux.bin \
107                -c boot/isolinux/boot.cat \
108                -hide-rr-moved \
109                -o $@ \
110                iso
111        /bin/rm -rf --one-file-system "$(WORKSPACE)/iso"
112
113target/bccd.amd64.iso.md5: target/bccd.amd64.iso
114# Change directory to make md5sum print just the filename
115        cd $(dir $<) && md5sum $(notdir $<) > $(notdir $@)
116
117# Added to test ISO w/o bccd deb #1008
118target/nobccd.amd64.iso.md5: target/nobccd.amd64.iso
119# Change directory to make md5sum print just the filename
120        cd $(dir $<) && md5sum $(notdir $<) > $(notdir $@)
121
122install-iso: target/bccd.amd64.iso.md5
123# Move the MD5 file target, and the associaetd ISO file, to ISO_INSTALL_DIR
124ifdef ISO_INSTALL_DIR
125        /bin/mv -v "$<" $(<:.md5=) "$(ISO_INSTALL_DIR)"
126endif
127
128# Added to test ISO w/o bccd deb #1008
129nobccd-install-iso: target/nobccd.amd64.iso.md5
130# Move the MD5 file target, and the associaetd ISO file, to ISO_INSTALL_DIR
131ifdef ISO_INSTALL_DIR
132        /bin/mv -v "$<" $(<:.md5=) "$(ISO_INSTALL_DIR)"
133endif
Note: See TracBrowser for help on using the repository browser.