X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=distro%2Fdeb%2FMakefile;h=df23602b592b94a07c7ef47d0792b030dad86e0b;hp=8147a50e68b0308a9949322e831ca9446cac4776;hb=a6ac90215b6238987c0bb0edcf1fbed2e9469266;hpb=1d4c0bb388168893d9f69d02e26ecbcd6ee7cfe5 diff --git a/distro/deb/Makefile b/distro/deb/Makefile index 8147a50..df23602 100644 --- a/distro/deb/Makefile +++ b/distro/deb/Makefile @@ -1,28 +1,43 @@ BASEDIR := ../.. -PREFIX := usr -BINDIR := $(PREFIX)/bin -DATADIR := $(PREFIX)/share -MANDIR := $(DATADIR)/man +PREFIX := /usr HEADER := $(BASEDIR)/gmqcc.h MAJOR := `sed -n -e '/GMQCC_VERSION_MAJOR/{s/.* .* //;p;q;}' $(HEADER)` MINOR := `sed -n -e '/GMQCC_VERSION_MINOR/{s/.* .* //;p;q;}' $(HEADER)` PATCH := `sed -n -e '/GMQCC_VERSION_PATCH/{s/.* .* //;p;q;}' $(HEADER)` DEBDIR := gmqcc-$(MAJOR).$(MINOR).$(PATCH) -DEB := $(DEBDIR).deb +CARCH := $(shell uname -m) +DEB := $(DEBDIR)-$(CARCH).deb +CONTROL := $(DEBDIR)/DEBIAN/control + +ifneq (, $(findstring i686, $(CARCH))) + CFLAGS := -m32 +endif base: - $(MAKE) -C $(BASEDIR) DESTDIR=distro/deb/$(DEBDIR)/ PREFIX=usr install + $(MAKE) -C $(BASEDIR) clean + $(MAKE) -C $(BASEDIR) DESTDIR=distro/deb/$(DEBDIR) PREFIX=$(PREFIX) install @install -d -m755 $(DEBDIR)/DEBIAN - @cp control $(DEBDIR)/DEBIAN/ - - @tar czf data.tar.gz $(DEBDIR)/[a-z]* - @tar czf control.tar.gz $(DEBDIR)/DEBIAN/* + @echo "Package: gmqcc" > $(CONTROL) + @echo "Version: $(MAJOR).$(MINOR).$(PATCH)" >> $(CONTROL) + @echo "Section: user/hidden" >> $(CONTROL) + @echo "Priority: optional" >> $(CONTROL) + @echo "Architecture: $(CARCH)" >> $(CONTROL) + @echo "Installed-Size: `du -ks $($(DEBDIR)/usr) | cut -f 1`" >> $(CONTROL) + @echo "Maintainer: Dale Weiler " >> $(CONTROL) + @echo "Description: An improved Quake C Compiler" >> $(CONTROL) + @echo " For an enduring period of time the options for a decent compiler for the Quake C programming language" >> $(CONTROL) + @echo " were confined to a specific compiler known as QCC. Attempts were made to extend and improve upon the" >> $(CONTROL) + @echo " design of QCC, but many foreseen the consequences of building on a broken foundation. The solution" >> $(CONTROL) + @echo " was obvious, a new compiler; one born from the NIH realm of sarcastic wit. We welcome you. You won't" >> $(CONTROL) + @echo " find a better Quake C compiler." >> $(CONTROL) + @tar czf data.tar.gz -C $(DEBDIR)/ . --exclude=DEBIAN + @tar czf control.tar.gz -C $(DEBDIR)/DEBIAN/ . @echo 2.0 > debian-binary @ar r $(DEB) debian-binary control.tar.gz data.tar.gz - @rm -rf $(DEBDIR) debian-binary control.tar.gz data.tar.gz + @rm -rf debian-binary control.tar.gz data.tar.gz $(DEBDIR) clean: - @rm $(DEB) - + $(MAKE) -C $(BASEDIR) clean + @rm -f *.deb all: base