]>
Commit | Line | Data |
---|---|---|
a5997a4c | 1 | ############################################################################### |
a5997a4c | 2 | # # |
70df8302 | 3 | # IPFire.org - A linux based firewall # |
eee037b8 | 4 | # Copyright (C) 2007-2018 IPFire Team <info@ipfire.org> # |
70df8302 MT |
5 | # # |
6 | # This program is free software: you can redistribute it and/or modify # | |
a5997a4c | 7 | # it under the terms of the GNU General Public License as published by # |
70df8302 | 8 | # the Free Software Foundation, either version 3 of the License, or # |
a5997a4c MT |
9 | # (at your option) any later version. # |
10 | # # | |
70df8302 | 11 | # This program is distributed in the hope that it will be useful, # |
a5997a4c MT |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # | |
14 | # GNU General Public License for more details. # | |
15 | # # | |
16 | # You should have received a copy of the GNU General Public License # | |
70df8302 | 17 | # along with this program. If not, see <http://www.gnu.org/licenses/>. # |
a5997a4c MT |
18 | # # |
19 | ############################################################################### | |
20 | ||
21 | ############################################################################### | |
22 | # Definitions | |
23 | ############################################################################### | |
24 | ||
25 | include Config | |
26 | ||
27 | VER = ipfire | |
28 | ||
27267889 MF |
29 | THISAPP = core-updates |
30 | TARGET = $(DIR_INFO)/$(THISAPP) | |
a5997a4c MT |
31 | |
32 | ############################################################################### | |
33 | # Top-level Rules | |
34 | ############################################################################### | |
35 | ||
36 | install : $(TARGET) | |
37 | ||
38 | check : | |
39 | ||
40 | download : | |
41 | ||
42 | md5 : | |
43 | ||
44 | ############################################################################### | |
45 | # Installation Details | |
46 | ############################################################################### | |
47 | ||
9cd0c7fd MT |
48 | CORE = $(patsubst $(DIR_SRC)/config/rootfiles/%,%,$(wildcard $(DIR_SRC)/config/rootfiles/core/*)) |
49 | ||
50 | $(TARGET) : $(CORE) | |
51 | ||
2e00d018 | 52 | .PHONY: |
9cd0c7fd | 53 | core/%: |
70e7351c | 54 | rm -rf /install/packages/package /tmp/* |
9cd0c7fd MT |
55 | mkdir -p /install/packages/package |
56 | eval $$(cat /usr/src/config/rootfiles/$@/meta) | |
9adaf7c5 | 57 | |
2e00d018 | 58 | #Generate ROOTFILES from filelists |
3ddd5b66 MT |
59 | BUILD_ARCH=$(BUILD_ARCH) BUILDTARGET=$(BUILDTARGET) KVER=$(KVER) \ |
60 | $(DIR_SRC)/src/scripts/archive.files \ | |
2e00d018 MT |
61 | $(DIR_SRC)/config/rootfiles/$@/filelists \ |
62 | $(DIR_SRC)/config/rootfiles/$@/files \ | |
dc7d6b20 | 63 | $(DIR_SRC)/config/rootfiles/$@/files.$(BUILD_ARCH) \ |
2e00d018 | 64 | > /tmp/ROOTFILES.tmp |
9adaf7c5 AF |
65 | |
66 | #remove excluded files from ROOTFILES | |
67 | grep -f $(DIR_SRC)/config/rootfiles/$@/exclude -v /tmp/ROOTFILES.tmp > /tmp/ROOTFILES | |
68 | rm -rf /tmp/ROOTFILES.tmp | |
69 | ||
70 | #Change KVER to Kernelversion | |
71 | sed -e "s/KVER/$(KVER)/g" -i /tmp/ROOTFILES | |
45e5371d | 72 | |
9adaf7c5 | 73 | #Remove doubled files with tar/untar/tar to save space |
b37678e9 | 74 | tar $(TAR_OPTIONS) -c --exclude='proc/*' --exclude='tmp/ROOTFILES' --exclude='__pycache__' --exclude='#*' --exclude='dev/pts/*' \ |
c2297690 MF |
75 | --exclude-from=$(DIR_SRC)/config/rootfiles/$@/exclude \ |
76 | -C / --files-from=/tmp/ROOTFILES -f /$(SNAME).tar | |
9adaf7c5 | 77 | mv -f /tmp/ROOTFILES /install/packages/package/ROOTFILES |
b37678e9 | 78 | tar $(TAR_OPTIONS) -p --numeric-owner -x -C /tmp -f /$(SNAME).tar |
9adaf7c5 | 79 | rm -f /$(SNAME).tar |
b37678e9 | 80 | cd /tmp && XZ_OPT="$(XZ_OPT)" tar $(TAR_OPTIONS) -cJf /install/packages/package/files.tar.xz $(TAR_OPTIONS) * && rm -rf * |
9adaf7c5 AF |
81 | cat /install/packages/package/ROOTFILES | grep -v "#" > /install/packages/package/ROOTFILES.tmp |
82 | rm /install/packages/package/ROOTFILES | |
83 | mv /install/packages/package/ROOTFILES.tmp /install/packages/package/ROOTFILES | |
84 | ||
85 | #build package | |
86 | cp -f $(DIR_SRC)/config/rootfiles/$@/update.sh /install/packages/package | |
9cd0c7fd | 87 | chmod 755 /install/packages/package/update.sh |
45e5371d AF |
88 | #Change xxxKVERxxx to Kernelversion |
89 | sed -e "s/xxxKVERxxx/$(KVER)/g" -i /install/packages/package/update.sh | |
90 | ||
98f0446e | 91 | cd /install/packages/package && tar cf ../core-upgrade-$(VERSION)-$$(basename $@).ipfire \ |
f83650a1 | 92 | update.sh files.tar.xz ROOTFILES |
9cd0c7fd MT |
93 | rm -rf /install/packages/package |
94 | sed -e "s/NAME/core-upgrade/g" \ | |
a5997a4c | 95 | -e "s/VER/$(VERSION)/g" \ |
9cd0c7fd | 96 | -e "s/RELEASE/$$(basename $@)/g" \ |
a5997a4c | 97 | -e "s/DEPS/$(DEPS)/g" \ |
9cd0c7fd MT |
98 | -e "s/SIZE/`ls -l \/install\/packages\/core-upgrade-$(VERSION)-$$(basename $@).ipfire | awk '{ print $$5 }'`/g" \ |
99 | < /usr/src/src/pakfire/meta > /install/packages/meta-core-upgrade-$$(basename $@) |