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

Last change on this file since 5990 was 5990, checked in by skylar, 3 years ago

apt-key now requires gnupg2 re #1003

  • Property svn:keywords set to Id
File size: 3.0 KB
Line 
1# $Id: Makefile 5990 2018-02-21 04:08:21Z 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        # Dependency on gnupg2 is required by apt-key
21        fpm \
22                -n bccd \
23                -C "$(WORKSPACE)"/src \
24                -s dir \
25                -t deb \
26                -d gnupg2 \
27                -p "$(WORKSPACE)"/target/bccd.noarch.deb \
28                -v "$(VERSION)" \
29                --iteration "$(SVN_REVISION)" \
30                -x '*/.svn*' \
31                --before-install "$(WORKSPACE)/bin/deb/bccd_deb_before_install" \
32                --after-remove "$(WORKSPACE)/bin/deb/bccd_deb_after_remove" \
33                --after-install "$(WORKSPACE)/bin/deb/bccd_deb_after_install"
34
35debootstrap:
36        # Script will either create a new debootstrap (if executing a debootstrap project) or extract the imported
37        # debootstrap.tar.bz2 artifact
38        "$(WORKSPACE)"/bin/prepare_debootstrap
39
40target/debootstrap-bccd.tar.bz2: target/bccd.noarch.deb debootstrap
41        /bin/cp -v "$<" "$(WORKSPACE)/debootstrap/tmp"
42        "$(WORKSPACE)/bin/bccd_install_pkgs"
43        # Using pbzip2 takes a couple minutes but saves 50% / 2+GB of space
44        /bin/tar -C "$(WORKSPACE)" -cf - debootstrap | nice /usr/bin/pbzip2 -c > "$(@)"
45
46target/debootstrap.tar.bz2: debootstrap
47        /bin/tar -C "$(WORKSPACE)" -cf - "$<" | nice /usr/bin/pbzip2 -c > "$(@)"
48
49iso/live/initrd.img: debootstrap
50        /usr/bin/sudo /usr/sbin/chroot "$(WORKSPACE)/debootstrap" mkinitramfs \
51                -o "/boot/initrd-$(KERN_REV).diskless" "$(KERN_REV)"
52        /bin/cp "$(WORKSPACE)/debootstrap/boot/initrd-$(KERN_REV).diskless" "$(WORKSPACE)/$@"
53
54iso/live/vmlinuz: debootstrap
55        /bin/cp "$(WORKSPACE)/debootstrap/boot/vmlinuz-$(KERN_REV)" "$(WORKSPACE)/$@"
56
57iso/live/filesystem.squashfs: target/debootstrap-bccd.tar.bz2
58        nice /usr/bin/pbzip2 \
59                -dc "$<" \
60                | /bin/tar \
61                        -C "$(WORKSPACE)" \
62                        -xf -
63        nice /usr/local/bin/mksquashfs \
64                "debootstrap" \
65                "$@" \
66                -comp xz
67
68target/bccd.amd64.iso: iso/live/filesystem.squashfs iso/live/initrd.img iso/live/vmlinuz
69        nice /usr/bin/genisoimage \
70                -pad \
71                -l \
72                -r \
73                -J \
74                -v \
75                -V "BCCDv3-$(SVN_REV)" \
76                -no-emul-boot \
77                -boot-load-size 4 \
78                -boot-info-table \
79                -b boot/isolinux/isolinux.bin \
80                -c boot/isolinux/boot.cat \
81                -hide-rr-moved \
82                -o $@ \
83                iso
84
85target/bccd.amd64.iso.md5: target/bccd.amd64.iso
86# Change directory to make md5sum print just the filename
87        cd $(dir $<) && md5sum $(notdir $<) > $(notdir $@)
88
89install-iso: target/bccd.amd64.iso.md5
90# Copy the MD5 file target, and the associaetd ISO file, to ISO_INSTALL_DIR
91ifdef ISO_INSTALL_DIR
92        /bin/cp -v "$<" $(<:.md5=) "$(ISO_INSTALL_DIR)"
93endif
Note: See TracBrowser for help on using the repository browser.