| 1 |
# BFH metapackages |
| 2 |
|
| 3 |
# Copyright (C) 2006-2026 Daniel Baumann <[email protected]> |
| 4 |
# |
| 5 |
# SPDX-License-Identifier: GPL-3.0+ |
| 6 |
# |
| 7 |
# This program is free software: you can redistribute it and/or modify |
| 8 |
# it under the terms of the GNU General Public License as published by |
| 9 |
# the Free Software Foundation, either version 3 of the License, or |
| 10 |
# (at your option) any later version. |
| 11 |
# |
| 12 |
# This program is distributed in the hope that it will be useful, |
| 13 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
# GNU General Public License for more details. |
| 16 |
# |
| 17 |
# You should have received a copy of the GNU General Public License |
| 18 |
# along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 19 |
|
| 20 |
SHELL := sh -e |
| 21 |
|
| 22 |
PROJECT := bfh-metapackages |
| 23 |
VERSION := $(shell cat VERSION.txt) |
| 24 |
|
| 25 |
all: build |
| 26 |
|
| 27 |
clean: clean-man |
| 28 |
|
| 29 |
clean-man: |
| 30 |
$(MAKE) -C man clean |
| 31 |
|
| 32 |
build: build-man |
| 33 |
|
| 34 |
build-man: |
| 35 |
$(MAKE) -C man build |
| 36 |
|
| 37 |
test: |
| 38 |
@# empty |
| 39 |
|
| 40 |
install: install-doc install-man |
| 41 |
|
| 42 |
install-doc: |
| 43 |
mkdir -p $(DESTDIR)/usr/share/doc/$(PROJECT) |
| 44 |
cp *.txt $(DESTDIR)/usr/share/doc/$(PROJECT) |
| 45 |
|
| 46 |
install-man: build-man |
| 47 |
for SECTION in $$(seq 1 8); \ |
| 48 |
do \ |
| 49 |
if ls man/*.$${SECTION} > /dev/null 2>&1; \ |
| 50 |
then \ |
| 51 |
mkdir -p $(DESTDIR)/usr/share/man/man$${SECTION}; \ |
| 52 |
cp man/*.$${SECTION} $(DESTDIR)/usr/share/man/man$${SECTION}; \ |
| 53 |
fi; \ |
| 54 |
done |
| 55 |
|
| 56 |
uninstall: uninstall-doc uninstall-man |
| 57 |
rmdir --ignore-fail-on-non-empty $(DESTDIR) || true |
| 58 |
|
| 59 |
uninstall-doc: |
| 60 |
rm -rf $(DESTDIR)/usr/share/doc/$(PROJECT) |
| 61 |
rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/doc || true |
| 62 |
|
| 63 |
uninstall-man: |
| 64 |
for SECTION in $$(seq 1 8); \ |
| 65 |
do \ |
| 66 |
for FILE in man/*.$${SECTION}; \ |
| 67 |
do \ |
| 68 |
rm -f $(DESTDIR)/usr/share/man/man$${SECTION}/$$(basename $${FILE}); \ |
| 69 |
done; \ |
| 70 |
rmdir --ignore-fail-on-non-empty --parents $(DESTDIR)/usr/share/man/man$${SECTION} || true; \ |
| 71 |
done |
| 72 |
|
| 73 |
reinstall: clean uninstall build install |
| 74 |
|
| 75 |
release: clean |
| 76 |
git commit -a -s -S -m 'Releasing version $(VERSION).' || true |
| 77 |
git tag -s -m 'Tagging version $(VERSION).' v$(VERSION) || true |
| 78 |
|
| 79 |
mkdir -p $(PROJECT)-$(VERSION) |
| 80 |
find . -mindepth 1 -maxdepth 1 -and -not -name ".git*" -and -not -name debian -and -not -name $(PROJECT)-$(VERSION) -exec cp \-a {} $(PROJECT)-$(VERSION) \; |
| 81 |
|
| 82 |
for FORMAT in xz lzip; \ |
| 83 |
do \ |
| 84 |
EXTENSION=$$(echo $${FORMAT} | cut -b-2); \ |
| 85 |
tar --$${FORMAT} -cf ../$(PROJECT)-$(VERSION).tar.$${EXTENSION} $(PROJECT)-$(VERSION); \ |
| 86 |
sha512sum ../$(PROJECT)-$(VERSION).tar.$${EXTENSION} > ../$(PROJECT)-$(VERSION).tar.$${EXTENSION}.sha512; \ |
| 87 |
gpg --default-key 00xFBB4F0E80A80222 --armor -b ../$(PROJECT)-$(VERSION).tar.$${EXTENSION}; \ |
| 88 |
mv ../$(PROJECT)-$(VERSION).tar.$${EXTENSION}.asc ../$(PROJECT)-$(VERSION).tar.$${EXTENSION}.sig; \ |
| 89 |
done |
| 90 |
|
| 91 |
rm -rf $(PROJECT)-$(VERSION) |
| 92 |
|
| 93 |
upload: |
| 94 |
scp ../$(PROJECT)-$(VERSION).* apt.progress-linux.org:/srv/apt.progress-linux.org/archive/upstream/$(PROJECT) |