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

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

nobccd makefile targets re #1008

  • Property svn:keywords set to Id
File size: 4.3 KB
Line 
1# $Id: Makefile 6048 2018-07-08 22:34:18Z 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/*' -cf - debootstrap | nice /usr/bin/pbzip2 -c > "$(@)"
49
50target/debootstrap.tar.bz2: debootstrap
51        /bin/tar -C "$(WORKSPACE)" --exclude='debootstrap/proc/*' -cf - "$<" | nice /usr/bin/pbzip2 -c > "$(@)"
52
53iso/live/initrd.img: debootstrap
54        /usr/bin/sudo /usr/sbin/chroot "$(WORKSPACE)/debootstrap" mkinitramfs \
55                -o "/boot/initrd-$(KERN_REV).diskless" "$(KERN_REV)"
56        /bin/cp "$(WORKSPACE)/debootstrap/boot/initrd-$(KERN_REV).diskless" "$(WORKSPACE)/$@"
57
58iso/live/vmlinuz: debootstrap
59        /bin/cp "$(WORKSPACE)/debootstrap/boot/vmlinuz-$(KERN_REV)" "$(WORKSPACE)/$@"
60
61iso/live/filesystem.squashfs: target/debootstrap-bccd.tar.bz2
62        nice "$(WORKSPACE)"/bin/make_filesystem_squashfs -o "$@" < "$<"
63
64# Added to test ISO w/o bccd deb #1008
65nobccd-filesystem.squashfs: target/debootstrap.tar.bz2
66        nice "$(WORKSPACE)"/bin/make_filesystem_squashfs -o iso/live/filesystem.squashfs < "$<"
67
68iso/boot/isolinux/isolinux.bin:
69        cp /usr/lib/ISOLINUX/isolinux.bin $@
70
71iso/boot/isolinux/ldlinux.c32:
72        cp /usr/lib/syslinux/modules/bios/ldlinux.c32 $@
73
74target/bccd.amd64.iso: iso/boot/isolinux/isolinux.bin iso/boot/isolinux/ldlinux.c32 iso/live/filesystem.squashfs iso/live/initrd.img iso/live/vmlinuz
75        nice /usr/bin/genisoimage \
76                -pad \
77                -l \
78                -r \
79                -J \
80                -v \
81                -V "BCCDv3-$(SVN_REV)" \
82                -no-emul-boot \
83                -boot-load-size 4 \
84                -boot-info-table \
85                -b boot/isolinux/isolinux.bin \
86                -c boot/isolinux/boot.cat \
87                -hide-rr-moved \
88                -o $@ \
89                iso
90
91target/nobccd.amd64.iso: iso/boot/isolinux/isolinux.bin iso/boot/isolinux/ldlinux.c32 nobccd-filesystem.squashfs iso/live/initrd.img iso/live/vmlinuz
92        nice /usr/bin/genisoimage \
93                -pad \
94                -l \
95                -r \
96                -J \
97                -v \
98                -V "BCCDv3-$(SVN_REV)" \
99                -no-emul-boot \
100                -boot-load-size 4 \
101                -boot-info-table \
102                -b boot/isolinux/isolinux.bin \
103                -c boot/isolinux/boot.cat \
104                -hide-rr-moved \
105                -o $@ \
106                iso
107
108# Added to test ISO w/o bccd deb #1008
109target/nobccd.amd64.iso.md5: target/nobccd.amd64.iso
110# Change directory to make md5sum print just the filename
111        cd $(dir $<) && md5sum $(notdir $<) > $(notdir $@)
112
113install-iso: target/bccd.amd64.iso.md5
114# Copy the MD5 file target, and the associaetd ISO file, to ISO_INSTALL_DIR
115ifdef ISO_INSTALL_DIR
116        /bin/cp -v "$<" $(<:.md5=) "$(ISO_INSTALL_DIR)"
117endif
118
119# Added to test ISO w/o bccd deb #1008
120nobccd-install-iso: target/nobccd.amd64.iso.md5
121# Copy the MD5 file target, and the associaetd ISO file, to ISO_INSTALL_DIR
122ifdef ISO_INSTALL_DIR
123        /bin/cp -v "$<" $(<:.md5=) "$(ISO_INSTALL_DIR)"
124endif
Note: See TracBrowser for help on using the repository browser.