Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 101393 | Differences between
and this patch

Collapse All | Expand All

(-)../gpe-othello-0.2-1-r0/gpe-othello-0.2-1/build/Makefile.dpkg_ipkg (+114 lines)
Line 0 Link Here
1
## Please read the README in this directory to see how to use this
2
## Makefile snippet
3
4
# Let's use whatever clean target the specific app provides
5
6
CONTROL = `if test -e familiar/control1; then echo control1; else echo control; fi`
7
8
# URL to source tarball
9
SOURCE = ftp://gpe.handhelds.org/gpe/source/$(PACKAGE)-$(VERSION).tar.gz
10
11
# can change this to e.g. /var/tmp/deb
12
DEB_PATH = ../deb
13
14
ifeq ($(CVSBUILD),yes)
15
LIBGPEWIDGET_PC = libgpewidget-uninstalled
16
PC_EXTRA=PKG_CONFIG_PATH=../../base/libgpewidget
17
else
18
LIBGPEWIDGET_PC = libgpewidget
19
endif
20
21
ifeq ($(IN_LIBGPEWIDGET),)
22
GPECFLAGS = $(shell $(PC_EXTRA) pkg-config --cflags $(LIBGPEWIDGET_PC))
23
GPELIBS = $(shell $(PC_EXTRA) pkg-config --libs $(LIBGPEWIDGET_PC))
24
endif
25
26
GTKCFLAGS = $(shell pkg-config --cflags gtk+-2.0)
27
GTKLIBS = $(shell pkg-config --libs gtk+-2.0)
28
29
STANDARD_CPPFLAGS = -D_GNU_SOURCE -DPACKAGE=\"$(PACKAGE)\" -DPREFIX=\"$(PREFIX)\" -DPACKAGE_LOCALE_DIR=\"$(PREFIX)/share/locale\"
30
STANDARD_CFLAGS = -MD -Wall
31
32
ifeq ($(DEBUG),yes)
33
CFLAGS += -O2 -g
34
LDFLAGS = -g
35
else
36
CFLAGS += -Os -fomit-frame-pointer
37
endif
38
39
dist: check-source clean dist-prep
40
	rm -rf ../$(PACKAGE)-$(VERSION)
41
	mkdir ../$(PACKAGE)-$(VERSION)
42
	( tar cf - --exclude "*/CVS" --exclude CVS --exclude "*~" --exclude "#*#" --exclude "debian" --exclude ".*" --exclude "*.ipk" --exclude "*.ipk.*" --exclude "*.mo" --exclude "*.batch" --exclude "translation-ipkgs.txt" * ) | (cd ../$(PACKAGE)-$(VERSION); tar xf -)
43
	( cd ../$(PACKAGE)-$(VERSION); mkdir build; cp $(BUILD)/Makefile.dpkg_ipkg $(BUILD)/Makefile.translation build/ ; sed 's:^CVSBUILD.*:CVSBUILD = no:' < Makefile > Makefile.new; mv Makefile.new Makefile )
44
	( cd .. ; tar cf - $(PACKAGE)-$(VERSION) | gzip -9 >$(PACKAGE)-$(VERSION).tar.gz )
45
	rm -rf ../$(PACKAGE)-$(VERSION)
46
	$(MAKE) printinfo
47
48
dist-upload: dist
49
	scp ../$(PACKAGE)-$(VERSION).tar.gz $(USER)@handhelds.org:/home/ftp/pub/projects/gpe/source/
50
51
dist-prep:
52
ipkg-prep:
53
install-mo:
54
# empty, can be filled in Makefile.translation
55
56
install: install-program install-mo
57
58
clean-dist:
59
	rm -rf familiar/dist familiar/dist.list
60
61
clean: clean-dist
62
63
check-source:
64
	@if [ -e familiar ] && ! grep -q '^Source:' familiar/$(CONTROL); then echo -e "\nNo Source: field in control file.  Aborting.\n"; exit 1; fi
65
66
ipkg: check-source ipkg-prep clean
67
	rm -rf familiar/dist
68
	mkdir -p familiar/dist/CONTROL
69
	sed 's:VERSION:$(VERSION):;s$$SOURCE$$$(SOURCE)$$' < familiar/$(CONTROL) > familiar/dist/CONTROL/control
70
	if test -e familiar/conffiles; then install -m 644 familiar/conffiles familiar/dist/CONTROL; fi
71
	if test -e familiar/preinst;   then install familiar/preinst   familiar/dist/CONTROL; fi
72
	if test -e familiar/postinst;  then install familiar/postinst  familiar/dist/CONTROL; fi
73
	if test -e familiar/prerm;     then install familiar/prerm     familiar/dist/CONTROL; fi
74
	if test -e familiar/postrm;    then install familiar/postrm    familiar/dist/CONTROL; fi
75
	$(MAKE) DESTDIR=`pwd`/familiar/dist PREFIX=/usr prefix=/usr DEBUG=no install-program
76
	rm -rf familiar/dist.list
77
	ipkg-build -o 0 -g 0 familiar/dist | sed 's/^Packaged .*into //; t 1; d; : 1; s:.*/::' >> familiar/dist.list
78
	if [ "x$(LINGUAS)" != "x" ]; then make translation-ipkg; tr ' ' '\n' < translation-ipkgs.txt >> familiar/dist.list; fi
79
	md5sum `cat familiar/dist.list` > $(PACKAGE)_$(VERSION).batch
80
	rm -rf familiar/dist familiar/dist.list
81
	$(MAKE) printinfo
82
83
dpkg: dist
84
	mkdir -p $(DEB_PATH)
85
	( olddir=`pwd`; cd $(DEB_PATH); rm -rf $(PACKAGE)-$(VERSION); ln -s $$olddir/../$(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)_$(VERSION).orig.tar.gz ; tar xzf $(PACKAGE)_$(VERSION).orig.tar.gz )
86
	mkdir -p $(DEB_PATH)/$(PACKAGE)-$(VERSION)/debian
87
	for i in debian/*; do if test -f $$i; then cp $$i $(DEB_PATH)/$(PACKAGE)-$(VERSION)/debian/; fi; done
88
89
CVSTAG := $(shell echo $(PACKAGE)-$(VERSION) | tr [a-z.] [A-Z_])
90
printinfo:
91
	@printf '-------------------------------------------------------------------------------\n'
92
	@printf "If this becomes a package release, please add a CVS tag.\n"
93
	@printf "You can use 'make tag' for that, it will execute\n"
94
	@printf "   cvs tag %s\n" $(CVSTAG)
95
	@printf "Please upload a tarball (created with 'make dist') to\n"
96
	@printf "   ftp://ftp.handhelds.org/pub/projects/gpe/\n"
97
	@printf "   (handhelds.org:~ftp/pub/projects/gpe/source)\n"
98
	@printf "You can use 'make dist-upload' to do that.\n"
99
	@printf "You are currently known as USER %s.\n" $(USER)
100
	@printf '-------------------------------------------------------------------------------\n'
101
102
tag: check-source
103
	cvs tag $(CVSTAG)
104
105
retag: check-source
106
	cvs tag -F $(CVSTAG)
107
108
source: tag dist-upload
109
110
%.pc: %.pc.in
111
	sed 's:PREFIX:$(PREFIX):;s:BUILDDIR:$(shell pwd):;s:VERSION:$(VERSION):' < $< > $@
112
113
.c.o:;
114
	$(CC) $(CFLAGS) $(CPPFLAGS) $(PACKAGE_CFLAGS) $(PACKAGE_CPPFLAGS) -c $< -o $@
(-)../gpe-othello-0.2-1-r0/gpe-othello-0.2-1/build/Makefile.translation (+103 lines)
Line 0 Link Here
1
.SUFFIXES: .mo .po .pot .po8
2
3
CONTROL = `if test -e familiar/control1; then echo control1; else echo control; fi`
4
5
# use ipkg-build or ipkg-deb-build
6
IPKG_BUILD := ipkg-build
7
8
TRANSLATION_SITE := http://www.iro.umontreal.ca/~gnutra/maint
9
10
ifeq ($(DIR_PO),)
11
DIR_PO := po
12
endif
13
14
ifeq ($(BINPACKAGE),)
15
BINPACKAGE := $(PACKAGE)
16
endif
17
18
mo-files = $(patsubst %,$(DIR_PO)/%.mo,$(LINGUAS))
19
po-files = $(patsubst %,$(DIR_PO)/%.po,$(LINGUAS))
20
21
ifeq ($(shell if [ -f $(PACKAGE).desktop.in ]; then echo present; fi;),present)
22
desktop-files += $(PACKAGE).desktop
23
endif
24
25
ifneq ($(EXTRA_DESKTOPS),)
26
desktop-files += $(patsubst %.desktop.in,%.desktop,$(EXTRA_DESKTOPS))
27
endif
28
29
all-mo: $(mo-files)
30
31
all-desktop: $(desktop-files)
32
33
install-mo: all-mo
34
	if [ "x$(LINGUAS)" != "x" ]; then \
35
		for i in $(LINGUAS); do mkdir -p $(DESTDIR)$(PREFIX)/share/locale/$$i/LC_MESSAGES; install -m 644 $(DIR_PO)/$$i.mo $(DESTDIR)$(PREFIX)/share/locale/$$i/LC_MESSAGES/$(PACKAGE).mo; done \
36
	fi;
37
38
.po8.mo:;
39
	msgfmt -o $@ $<
40
41
.po.po8:;
42
	CTYPE=`grep "^\"Content-Type:" $< | sed 's/^.*charset=//;s/\\\\.*//'`; sed "s/\(Content-Type: .*=\)$$CTYPE/\1UTF-8/" < $< | iconv -f $${CTYPE} -t UTF-8 >$@
43
44
update-po: $(po-files) extract-po
45
46
dist-prep: update-po freshen-po
47
# empty
48
49
ifeq ($(CVSBUILD),yes)
50
ipkg-prep: freshen-po
51
# empty
52
endif
53
54
extract-po:
55
	mkdir -p $(DIR_PO)
56
	( SOURCES="$(SOURCES)"; for DESK in $(PACKAGE).desktop.in $(EXTRA_DESKTOPS); do if [ -f $$DESK ]; then intltool-extract --type=gettext/ini $$DESK; SOURCES="$$SOURCES $${DESK}.h"; fi; done; if [ "x$$SOURCES" != "x" ]; then xgettext --add-comments=TRANSLATORS: -k_ -kN_ -o $(DIR_PO)/$(PACKAGE).pot.new $$SOURCES; fi )
57
	if [ -f $(DIR_PO)/$(PACKAGE).pot.new ]; then if cmp -s $(DIR_PO)/$(PACKAGE).pot.new $(PACKAGE).pot; then rm $(DIR_PO)/$(PACKAGE).pot.new; else mv $(DIR_PO)/$(PACKAGE).pot.new $(DIR_PO)/$(PACKAGE).pot; fi; fi
58
59
clean: clean-po clean-dist-translation
60
61
clean-po:
62
	rm -rf $(DIR_PO)/*.mo
63
	for i in $(desktop-files); do if [ -f $$i.in ]; then rm -f $$i; rm -f $$i.in.h; fi; done
64
65
%.desktop: %.desktop.in $(patsubst %,$(DIR_PO)/%.po,$(LINGUAS))
66
	intltool-merge -u -d $(DIR_PO) $< $@
67
68
freshen-po:
69
	rm -rf tmp-po
70
	mkdir tmp-po
71
	cd tmp-po; for LANG in $(LINGUAS); do wget $(TRANSLATION_SITE)/$(PACKAGE)/$$LANG.po; done
72
	for LANG in $(LINGUAS); do if [ ! -f $(DIR_PO)/$$LANG.po ] || ! cmp -s $(DIR_PO)/$$LANG.po tmp-po/$$LANG.po ; then mv tmp-po/$$LANG.po $(DIR_PO)/$$LANG.po; echo "Updated $$LANG translation"; fi; done
73
	rm -rf tmp-po
74
75
# ------------------------------------------------------------------------
76
77
MAINTAINER = $(shell grep 'Maintainer: ' familiar/$(CONTROL) | cut -d ' ' -f 2-)
78
79
ifndef BUILD
80
BUILD = ../build
81
endif
82
83
transdist := familiar/dist-translation
84
templates := $(BUILD)/familiar
85
ipkglist  := translation-ipkgs.txt
86
87
clean-dist-translation:
88
	rm -rf $(transdist) $(ipkglist)
89
90
real-translation-package: all-mo
91
	rm -rf $(transdist) $(ipkglist)
92
	for LINGUA in $(LINGUAS); do \
93
		i=$$(echo $$LINGUA | tr '[A-Z_]' '[a-z+]'); \
94
		mkdir -p $(transdist)/$$i/CONTROL; \
95
		mkdir -p $(transdist)/$$i$(PREFIX)/share/locale/$$LINGUA/LC_MESSAGES; \
96
		install -m 644 po/$$LINGUA.mo $(transdist)/$$i$(PREFIX)/share/locale/$$LINGUA/LC_MESSAGES/$(PACKAGE).mo; \
97
		sed -e "s/<maintainer>/$(MAINTAINER)/;s/<package>/$(BINPACKAGE)/;s/<version>/$(VERSION)/;s/<language>/$$i/;s!<source>!$(SOURCE)!" $(templates)/control.translation > $(transdist)/$$i/CONTROL/control; \
98
		install $(templates)/postinst.translation $(transdist)/$$i/CONTROL/postinst; \
99
		$(IPKG_BUILD) -g 0 -o 0 $(transdist)/$$i | sed 's/^Packaged .*into //; t 1; d; : 1; s:.*/::' >> $(ipkglist); \
100
	done
101
102
translation-ipkg:
103
	make PREFIX=/usr real-translation-package
(-)../gpe-othello-0.2-1-r0/gpe-othello-0.2-1/Makefile (-19 / +16 lines)
Lines 3-43 Link Here
3
DEBUG = no
3
DEBUG = no
4
LINGUAS = 
4
LINGUAS = 
5
VERSION = 0.2-1
5
VERSION = 0.2-1
6
DEBUG = no
7
CVSBUILD = no
6
8
7
MEMBERS = callbacks gameutils moteur deepblue support globals main
9
MEMBERS = callbacks gameutils moteur deepblue support globals main
8
10
9
GTKCFLAGS = `pkg-config --cflags gtk+-2.0` -DGTK_ENABLE_BROKEN
11
GTKCFLAGS = `pkg-config --cflags gtk+-2.0`
10
GTKLDFLAGS += `pkg-config --libs gtk+-2.0`
12
GTKLDFLAGS = `pkg-config --libs gtk+-2.0 gdk-2.0`
11
13
12
PACKAGE_CPPFLAGS = $(GTKCFLAGS) -D_GNU_SOURCE 
14
PACKAGE_CFLAGS += $(STANDARD_CFLAGS) $(GTKCFLAGS) $(GPECFLAGS)
13
ifeq ($(DEBUG),yes)
15
PACKAGE_CPPFLAGS += $(STANDARD_CPPFLAGS) -DPACKAGE=\"$(PACKAGE)\" -DPREFIX=\"$(PREFIX)\" -DPACKAGE_LOCALE_DIR=\"$(PREFIX)/share/locale\"
14
PACKAGE_CFLAGS += -O2 -g
16
PACKAGE_LDFLAGS += $(STANDARD_LDFLAGS) $(GTKLDFLAGS) $(GPELIBS)
15
PACKAGE_LDFLAGS = -g
17
18
ifeq ($(CVSBUILD),yes)
19
BUILD = ../build
16
else
20
else
17
PACKAGE_CFLAGS += -Os -fomit-frame-pointer
21
BUILD = build
18
endif
22
endif
19
PACKAGE_CFLAGS += -Wall -I../../base/libgpewidget
20
PACKAGE_CPPFLAGS += -DPACKAGE=\"$(PACKAGE)\" -DPREFIX=\"$(PREFIX)\" -DPACKAGE_LOCALE_DIR=\"$(PREFIX)/share/locale\"
21
PACKAGE_CFLAGS += -MD
22
23
PACKAGE_LDFLAGS += -L../../base/libgpewidget -lgpewidget
24
25
.SUFFIXES: .d
26
23
27
OBJS = $(patsubst %,%.o,$(MEMBERS))
24
OBJS = $(patsubst %,%.o,$(MEMBERS))
28
DEPS = $(patsubst %,%.d,$(MEMBERS))
29
SOURCES = $(patsubst %,%.c,$(MEMBERS))
25
SOURCES = $(patsubst %,%.c,$(MEMBERS))
26
DEPS = $(patsubst %,%.d,$(MEMBERS))
30
27
31
PIXMAPS = bell.png
28
PIXMAPS = bell.png
32
29
33
all: $(PACKAGE)
30
all: $(PACKAGE)
34
31
35
$(PACKAGE): $(OBJS)
32
$(PACKAGE): $(OBJS)
36
	$(CC) -o $@ $^  $(GTKLDFLAGS) $(LDFLAGS) $(PACKAGE_LDFLAGS)
33
	$(CC) -o $@ $^ $(LDFLAGS) $(PACKAGE_LDFLAGS)
37
34
38
install-program: all 
35
install-program: all 
39
	install -D $(PACKAGE) $(DESTDIR)$(PREFIX)/bin/$(PACKAGE)
36
	install -s -D $(PACKAGE) $(DESTDIR)$(PREFIX)/bin/$(PACKAGE)
40
	strip $(DESTDIR)$(PREFIX)/bin/$(PACKAGE)
41
	install -d $(DESTDIR)$(PREFIX)/share/pixmaps
37
	install -d $(DESTDIR)$(PREFIX)/share/pixmaps
42
	install -m 644 $(PACKAGE).png $(DESTDIR)$(PREFIX)/share/pixmaps/
38
	install -m 644 $(PACKAGE).png $(DESTDIR)$(PREFIX)/share/pixmaps/
43
	install -d $(DESTDIR)$(PREFIX)/share/applications
39
	install -d $(DESTDIR)$(PREFIX)/share/applications
Lines 48-52 Link Here
48
clean:
44
clean:
49
	rm -f $(PACKAGE) $(OBJS) $(DEPS)
45
	rm -f $(PACKAGE) $(OBJS) $(DEPS)
50
46
51
include ../../base/build/Makefile.dpkg_ipkg
47
include $(BUILD)/Makefile.dpkg_ipkg
48
include $(BUILD)/Makefile.translation
52
-include $(DEPS)
49
-include $(DEPS)

Return to bug 101393