summaryrefslogtreecommitdiffstats
path: root/pkg/linux/module.rules
blob: afed877371734fe2225d6d9476fa7d78b0d7173d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
pkg.create.flatpak:: contrib.fetch $(PKG.all.flatpak)
pkg.create.plugins.flatpak:: $(PKG.plugins.flatpak)
pkg.create.flathub:: $(FLATHUB_MANIFEST)
pkg.create.deb:: $(PKG.gui.deb) $(PKG.cli.deb)
pkg.create.rpm:: $(PKG.rpm.stamp)
pkg.create.src.deb:: $(PKG.src.deb.stamp)
pkg.create.tar:: pkg.create $(PKG.cli.tar)
mediasdk:: $(PKG.mediasdk.flatpak)

DEBIAN_CHANGELOG_DATE = $(shell date -R)

#
# CLI Tar Package
#
$(PKG.cli.tar): | $(dir $(PKG.cli.tar))
$(PKG.cli.tar): | $(STAGE.out.cli/)
	cd $(STAGE.out.cli/) && $(TAR.exe) cjf $(call fn.ABSOLUTE,$(PKG.cli.tar)) .


$(STAGE.out.cli/):
	-$(MKDIR.exe) -p $@
	$(CP.exe) HandBrakeCLI $(STAGE.out.cli/)
	$(call STAGE.doc,$(STAGE.out.cli/))

#
# RPM binary package rules
#
$(PKG.rpm.src.tar.bz2): $(STAGE.out.rpm.src/)
	$(TAR.exe) cjf $(PKG.rpm.src.tar.bz2) -C $(STAGE.out.rpm.src/) $(PKG.rpm.basename)

$(STAGE.out.rpm.src/): GNUmakefile
#	-$(MKDIR.exe) -p $(STAGE.out.rpm.src/)$(PKG.basename)
#	tar c --exclude build ../* | tar x -C $(STAGE.out.rpm.src/)$(PKG.basename)
	-$(RM.exe) -rf $(STAGE.out.src/)
	make contrib.fetch
	$(MKDIR.exe) -p $@
	$(GIT.exe) -C $(SRC/) archive --format=tar --prefix=$(PKG.rpm.basename)/ $(HB.repo.shorthash) | $(TAR.exe) -xC $@
	$(SRC/)scripts/repo-info.sh $(SRC/) > $@/$(PKG.rpm.basename)/version.txt
	-$(MKDIR.exe) $(STAGE.out.rpm.src/)$(PKG.rpm.basename)/download
	$(CP.exe) $(SRC/)download/*.tar.* $(STAGE.out.rpm.src/)$(PKG.rpm.basename)/download

$(PKG.native.rpm.stamp): $(PKG.rpm.src.tar.bz2)
	-$(MKDIR.exe) -p $(RPM.out/)SOURCES
	-$(MKDIR.exe) -p $(RPM.out/)SPECS
	-$(MKDIR.exe) -p $(RPM.out/)BUILD
	-$(MKDIR.exe) -p $(RPM.out/)RPMS
	-$(MKDIR.exe) -p $(RPM.out/)SRPMS
	-$(MKDIR.exe) -p $(RPMROOT.out/)
	echo "%define name $(HB.name.lower)" > $(RPM.out/)SPECS/ghb.spec
	echo "%define release $(PKG.release)" >> $(RPM.out/)SPECS/ghb.spec
	echo "%define version $(PKG.rpm.hb.version)" >> $(RPM.out/)SPECS/ghb.spec
	cat $(GTK.src/)ghb.spec >> $(RPM.out/)SPECS/ghb.spec
	$(CP.exe) $(PKG.rpm.src.tar.bz2) $(RPM.out/)SOURCES
	rpmbuild --define="_topdir $(RPM.out)" --buildroot $(RPMROOT.out) -ba $(RPM.out/)SPECS/ghb.spec
	$(TOUCH.exe) $(PKG.native.rpm.stamp)

$(PKG.rpm.stamp): | $(dir $(PKG.gui.rpm))
$(PKG.rpm.stamp): $(PKG.native.rpm.stamp)
	$(CP.exe) $(PKG.gui.native.rpm) $(PKG.gui.rpm)
	$(CP.exe) $(PKG.cli.native.rpm) $(PKG.cli.rpm)
	$(TOUCH.exe) $(PKG.rpm.stamp)

#
# Flatpak binary package rules
#
$(PKG.gui.manifest.flathub):
	$(MKDIR.exe) -p $(PKG.out.flatpak/)
	$(SRC/)scripts/create_flatpak_manifest.py $(FPQSV) -a "$(HB_URL)" -s "$(HB_SHA256)" -t $(PKG.gui.template.flatpak) $(foreach m,$(CONTRIBS),-c "$(word 1,$($m.FETCH.url))" -s "$(word 1,$($m.FETCH.sha256))") $(FPRUNTIME) $(PKG.gui.manifest.flathub)

$(PKG.cli.manifest.flathub):
	$(MKDIR.exe) -p $(PKG.out.flatpak/)
	$(SRC/)scripts/create_flatpak_manifest.py $(FPQSV) -a "$(HB_URL)" -s "$(HB_SHA256)" -t $(PKG.cli.template.flatpak) $(foreach m,$(CONTRIBS),-c "$(word 1,$($m.FETCH.url))" -s "$(word 1,$($m.FETCH.sha256))") $(FPRUNTIME) $(PKG.cli.manifest.flathub)

$(PKG.gui.flatpak): GNUmakefile $(PKG.gui.template.flatpak) $(PKG.src.tar.bz2)
	$(MKDIR.exe) -p $(STAGE.out.flatpak/)
	$(MKDIR.exe) -p $(PKG.out.flatpak/)
	$(SRC/)scripts/create_flatpak_manifest.py $(FPQSV) -a "$(abspath $(PKG.src.tar.bz2))" -t $(PKG.gui.template.flatpak) $(foreach m,$(CONTRIBS),-c "$(abspath $(CONTRIB.download/)$($m.FETCH.basename))") $(PKG.gui.manifest.flatpak)
	flatpak-builder --default-branch=$(PKG.branch.flatpak) --disable-cache --force-clean $(PGPSIGN) --repo=$(PKG.repo.flatpak) $(PKG.gui.build.flatpak) $(PKG.gui.manifest.flatpak)
	flatpak build-bundle $(PKG.repo.flatpak) $(PKG.gui.flatpak) $(PKG.gui.name.flatpak) $(PKG.branch.flatpak)

$(PKG.cli.flatpak): GNUmakefile $(PKG.cli.template.flatpak) $(PKG.src.tar.bz2)
	$(MKDIR.exe) -p $(STAGE.out.flatpak/)
	$(MKDIR.exe) -p $(PKG.out.flatpak/)
	$(SRC/)scripts/create_flatpak_manifest.py $(FPQSV) -a "$(abspath $(PKG.src.tar.bz2))" -t $(PKG.cli.template.flatpak) $(foreach m,$(CONTRIBS),-c "$(abspath $(CONTRIB.download/)$($m.FETCH.basename))") $(PKG.cli.manifest.flatpak)
	flatpak-builder --default-branch=$(PKG.branch.flatpak) --disable-cache --force-clean $(PGPSIGN) --repo=$(PKG.repo.flatpak) $(PKG.cli.build.flatpak) $(PKG.cli.manifest.flatpak)
	flatpak build-bundle $(PKG.repo.flatpak) $(PKG.cli.flatpak) $(PKG.cli.name.flatpak) $(PKG.branch.flatpak)

$(PKG.mediasdk.flatpak): GNUmakefile $(PKG.mediasdk.template.flatpak) $(PKG.gui.flatpak)
	$(MKDIR.exe) -p $(STAGE.out.flatpak/)
	$(MKDIR.exe) -p $(PKG.out.flatpak/)
	$(SRC/)scripts/create_flatpak_manifest.py -p -r $(PKG.branch.flatpak) -t $(PKG.mediasdk.template.flatpak) $(PKG.mediasdk.manifest.flatpak)
	-flatpak --user remove --noninteractive $(PKG.gui.name.flatpak)//$(PKG.branch.flatpak)
	flatpak --user install --noninteractive $(PKG.gui.flatpak)
	flatpak-builder --default-branch=$(PKG.branch.flatpak) --disable-cache --force-clean $(PGPSIGN) --repo=$(PKG.repo.flatpak) $(PKG.mediasdk.build.flatpak) $(PKG.mediasdk.manifest.flatpak)
#	flatpak-builder --run $(PKG.mediasdk.build.flatpak) $(PKG.mediasdk.manifest.flatpak) bash
	flatpak build-bundle --runtime $(PKG.repo.flatpak) $(PKG.mediasdk.flatpak) $(PKG.mediasdk.name.flatpak) $(PKG.plugin.version.flatpak)
	-flatpak --user remove --noninteractive $(PKG.gui.name.flatpak)//$(PKG.branch.flatpak)

#
# Debian binary package rules
#
$(PKG.gui.tmp.deb): | $(dir $(PKG.gui.tmp.deb))
$(PKG.gui.tmp.deb): GNUmakefile
	-$(RM.exe) $(SRC/)debian
	ln -s $(PKG.debian) $(SRC/)debian
	fakeroot $(MAKE) -C $(SRC/) -f debian/rules clean
	$(MAKE) BUILDDIR=$(abspath $(BUILD)) CONFIGURE=configure -C $(SRC/) -f debian/rules build
	echo $(PKG.out.abs/)
	fakeroot $(MAKE) FORCEVERSION="-- -v$(HB.debversion)" BUILDDIR=$(abspath $(BUILD)) CONFIGURE=configure PKGDESTDIR=$(PKG.out.abs/ -C $(SRC/) -f debian/rules binary


$(PKG.gui.deb): | $(dir $(PKG.gui.deb))
$(PKG.gui.deb): $(PKG.gui.tmp.deb)
	$(MV.exe) $(PKG.gui.tmp.deb) $(PKG.gui.deb)

$(PKG.cli.deb): | $(dir $(PKG.cli.deb))
$(PKG.cli.deb): $(PKG.gui.tmp.deb)
	$(MV.exe) $(PKG.cli.tmp.deb) $(PKG.cli.deb)

#
# Debian source package rules
#
pkg.push.src.deb:: $(PKG.src.deb.stamp)
	(cd $(STAGE.out.src/)disco && dput handbrake-git-snapshots $(HB.name.lower)_$(HB.debversion)-zhb-1ppa1~disco1_source.changes )
	(cd $(STAGE.out.src/)eoan && dput handbrake-git-snapshots $(HB.name.lower)_$(HB.debversion)-zhb-1ppa1~eoan1_source.changes )


$(PKG.src.deb.stamp): GNUmakefile
	-$(RM.exe) -rf $(STAGE.out.src/)
	make contrib.fetch
	$(MKDIR.exe) -p $(STAGE.out.src/)disco
	$(GIT.exe) -C $(SRC/) archive --format=tar --prefix=$(PKG.deb.basename)/ $(HB.repo.shorthash) | $(TAR.exe) -xC $(STAGE.out.src/)disco/
	$(SRC/)scripts/repo-info.sh $(SRC/) > $(STAGE.out.src/)disco/$(PKG.deb.basename)/version.txt
	$(CP.exe) -a $(SRC/)download $(STAGE.out.src/)disco/$(PKG.deb.basename)
	cp -a $(PKG.debian) $(STAGE.out.src/)disco/$(PKG.deb.basename)
	$(CP.exe) $(STAGE.out.src/)disco/$(PKG.deb.basename)/debian/control.disco $(STAGE.out.src/)disco/$(PKG.deb.basename)/debian/control
	$(CP.exe) $(STAGE.out.src/)disco/$(PKG.deb.basename)/debian/rules.disco $(STAGE.out.src/)disco/$(PKG.deb.basename)/debian/rules
	echo "$(HB.name.lower) (1:$(HB.debversion)-zhb-1ppa1~disco1) disco; urgency=low" > $(STAGE.out.src/)disco/$(PKG.deb.basename)/debian/changelog
	echo "" >> $(STAGE.out.src/)disco/$(PKG.deb.basename)/debian/changelog
	echo "  * Snapshot: See commit history at" >> $(STAGE.out.src/)disco/$(PKG.deb.basename)/debian/changelog
	echo "    https://github.com/HandBrake/HandBrake" >> $(STAGE.out.src/)disco/$(PKG.deb.basename)/debian/changelog
	echo "" >> $(STAGE.out.src/)disco/$(PKG.deb.basename)/debian/changelog
	echo " -- John Stebbins <jstebbins.hb@gmail.com>  $(DEBIAN_CHANGELOG_DATE)" >> $(STAGE.out.src/)disco/$(PKG.deb.basename)/debian/changelog
	$(TAR.exe) czf $(STAGE.out.src/)disco/$(PKG.src.deb.tar) -C $(STAGE.out.src/)disco $(PKG.deb.basename)
	(cd $(STAGE.out.src/)disco/$(PKG.deb.basename) && debuild -S -kjstebbins.hb)
	$(TOUCH.exe) $(PKG.src.deb.stamp)
	$(MKDIR.exe) -p $(STAGE.out.src/)eoan
	$(GIT.exe) -C $(SRC/) archive --format=tar --prefix=$(PKG.deb.basename)/ $(HB.repo.shorthash) | $(TAR.exe) -xC $(STAGE.out.src/)eoan/
	$(SRC/)scripts/repo-info.sh $(SRC/) > $(STAGE.out.src/)eoan/$(PKG.deb.basename)/version.txt
	$(CP.exe) -a $(SRC/)download $(STAGE.out.src/)eoan/$(PKG.deb.basename)
	cp -a $(PKG.debian) $(STAGE.out.src/)eoan/$(PKG.deb.basename)
	$(CP.exe) $(STAGE.out.src/)eoan/$(PKG.deb.basename)/debian/control.eoan $(STAGE.out.src/)eoan/$(PKG.deb.basename)/debian/control
	$(CP.exe) $(STAGE.out.src/)eoan/$(PKG.deb.basename)/debian/rules.eoan $(STAGE.out.src/)eoan/$(PKG.deb.basename)/debian/rules
	echo "$(HB.name.lower) (1:$(HB.debversion)-zhb-1ppa1~eoan1) eoan; urgency=low" > $(STAGE.out.src/)eoan/$(PKG.deb.basename)/debian/changelog
	echo "" >> $(STAGE.out.src/)eoan/$(PKG.deb.basename)/debian/changelog
	echo "  * Snapshot: See commit history at" >> $(STAGE.out.src/)eoan/$(PKG.deb.basename)/debian/changelog
	echo "    https://github.com/HandBrake/HandBrake" >> $(STAGE.out.src/)eoan/$(PKG.deb.basename)/debian/changelog
	echo "" >> $(STAGE.out.src/)eoan/$(PKG.deb.basename)/debian/changelog
	echo " -- John Stebbins <jstebbins.hb@gmail.com>  $(DEBIAN_CHANGELOG_DATE)" >> $(STAGE.out.src/)eoan/$(PKG.deb.basename)/debian/changelog
	$(TAR.exe) czf $(STAGE.out.src/)eoan/$(PKG.src.deb.tar) -C $(STAGE.out.src/)eoan $(PKG.deb.basename)
	(cd $(STAGE.out.src/)eoan/$(PKG.deb.basename) && debuild -S -kjstebbins.hb)
	$(TOUCH.exe) $(PKG.src.deb.stamp)