1 | # $Id: Makefile 5881 2017-02-12 17:45:58Z skylar $ |
---|
2 | |
---|
3 | export MKDIR_P := mkdir -p |
---|
4 | export SVNROOT := https://cluster.earlham.edu/svn/bccd-ng/branches/skylar/bccd-3.4.0-build_ng |
---|
5 | export SVN_REV = $(shell svn info $(SVNROOT)|awk '$$1 ~ /^Revision:/ {print $$2}') |
---|
6 | export SVN_CO := svn cat -r |
---|
7 | export VERSION := 3.4.0 |
---|
8 | export KERN_REV := 4.0.0bccd |
---|
9 | |
---|
10 | build: |
---|
11 | /bin/mkdir -p "$(WORKSPACE)"/build |
---|
12 | |
---|
13 | build/etc: build |
---|
14 | /bin/mkdir -p "$(WORKSPACE)"/build/etc |
---|
15 | |
---|
16 | build/etc/bccd-revision: build/etc |
---|
17 | @echo "$(VERSION).$(SVN_REVISION)" > "$(WORKSPACE)"/build/etc/bccd-revision |
---|
18 | |
---|
19 | target/bccd.noarch.deb: build/etc/bccd-revision |
---|
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 | |
---|
33 | debootstrap: target/bccd.noarch.deb |
---|
34 | $(MKDIR_P) "$(WORKSPACE)/debootstrap" |
---|
35 | /usr/bin/sudo /usr/sbin/debootstrap \ |
---|
36 | --exclude=linux-image-2.6.32-5,linux-image-2.6.32-5-amd64,linux-image-2.6.32-5-i686 \ |
---|
37 | --arch amd64 \ |
---|
38 | sid \ |
---|
39 | "$(WORKSPACE)/debootstrap" \ |
---|
40 | http://debmirror.cluster.earlham.edu |
---|
41 | /bin/cp $< "$(WORKSPACE)/debootstrap/tmp" |
---|
42 | "$(WORKSPACE)/bin/bccd_install_pkgs" |
---|
43 | |
---|
44 | iso/live/initrd.img: debootstrap |
---|
45 | /usr/bin/sudo /usr/sbin/chroot "$(WORKSPACE)/debootstrap" mkinitramfs \ |
---|
46 | -o /boot/initrd-$(KERN_REV).diskless $(KERN_REV) |
---|
47 | /bin/cp "$(WORKSPACE)/debootstrap/boot/initrd-$(KERN_REV).diskless" "$(WORKSPACE)/$@" |
---|
48 | |
---|
49 | iso/live/vmlinuz: debootstrap |
---|
50 | /bin/cp "$(WORKSPACE)/debootstrap/boot/vmlinuz-$(KERN_REV)" "$(WORKSPACE)/$@" |
---|
51 | |
---|
52 | iso/live/filesystem.squashfs: debootstrap |
---|
53 | /usr/local/bin/mksquashfs \ |
---|
54 | $< \ |
---|
55 | $@ \ |
---|
56 | -comp xz |
---|
57 | |
---|
58 | target/bccd.amd64.iso: iso/live/filesystem.squashfs iso/live/initrd.img iso/live/vmlinuz |
---|
59 | /usr/bin/genisoimage \ |
---|
60 | -pad \ |
---|
61 | -l \ |
---|
62 | -r \ |
---|
63 | -J \ |
---|
64 | -v \ |
---|
65 | -V "BCCDv3-$(SVN_REV)" \ |
---|
66 | -no-emul-boot \ |
---|
67 | -boot-load-size 4 \ |
---|
68 | -boot-info-table \ |
---|
69 | -b boot/isolinux/isolinux.bin \ |
---|
70 | -c boot/isolinux/boot.cat \ |
---|
71 | -hide-rr-moved \ |
---|
72 | -o $@ \ |
---|
73 | iso |
---|