Merge branch 'org.openembedded.dev' of git@git.openembedded.net:openembedded into...
[openembedded.git] / packages / blueprobe / files / blueprobe-svn-Makefile.patch
1 diff -Naur blueprobe.orig/Makefile blueprobe/Makefile
2 --- blueprobe.orig/Makefile     2007-02-10 16:23:12.158675487 +0200
3 +++ blueprobe/Makefile  2007-02-10 16:27:53.906731396 +0200
4 @@ -1,7 +1,7 @@
5  PREFIX = /usr/local
6  PACKAGE = blueprobe
7  DEBUG = no
8 -CVSBUILD = yes
9 +CVSBUILD = no
10  VERSION = 0.18
11  
12  MEMBERS = blueprobe
13 @@ -17,7 +17,7 @@
14  ifeq ($(CVSBUILD),yes)
15  BUILD = ../build
16  else
17 -BUILD = build
18 +BUILD = .
19  endif
20  
21  all: $(PACKAGE)
22 diff -Naur blueprobe.orig/Makefile.dpkg_ipkg blueprobe/Makefile.dpkg_ipkg
23 --- blueprobe.orig/Makefile.dpkg_ipkg   1970-01-01 02:00:00.000000000 +0200
24 +++ blueprobe/Makefile.dpkg_ipkg        2007-02-10 16:28:13.211831530 +0200
25 @@ -0,0 +1,114 @@
26 +## Please read the README in this directory to see how to use this
27 +## Makefile snippet
28 +
29 +# Let's use whatever clean target the specific app provides
30 +
31 +CONTROL = `if test -e familiar/control1; then echo control1; else echo control; fi`
32 +
33 +# URL to source tarball
34 +SOURCE = http://gpe.linuxtogo.org/download/source/$(PACKAGE)-$(VERSION).tar.gz
35 +
36 +# can change this to e.g. /var/tmp/deb
37 +DEB_PATH = ../deb
38 +
39 +ifeq ($(CVSBUILD),yes)
40 +LIBGPEWIDGET_PC = libgpewidget-uninstalled
41 +PC_EXTRA=PKG_CONFIG_PATH=../../base/libgpewidget
42 +else
43 +LIBGPEWIDGET_PC = libgpewidget
44 +endif
45 +
46 +ifeq ($(IN_LIBGPEWIDGET),)
47 +GPECFLAGS = $(shell $(PC_EXTRA) pkg-config --cflags $(LIBGPEWIDGET_PC))
48 +GPELIBS = $(shell $(PC_EXTRA) pkg-config --libs $(LIBGPEWIDGET_PC))
49 +endif
50 +
51 +GTKCFLAGS = $(shell pkg-config --cflags gtk+-2.0)
52 +GTKLIBS = $(shell pkg-config --libs gtk+-2.0)
53 +
54 +STANDARD_CPPFLAGS = -D_GNU_SOURCE -DPACKAGE=\"$(PACKAGE)\" -DPREFIX=\"$(PREFIX)\" -DPACKAGE_LOCALE_DIR=\"$(PREFIX)/share/locale\"
55 +STANDARD_CFLAGS = -MD -Wall
56 +
57 +ifeq ($(DEBUG),yes)
58 +CFLAGS += -O2 -g
59 +LDFLAGS = -g
60 +else
61 +CFLAGS += -Os -fomit-frame-pointer
62 +endif
63 +
64 +dist: check-source clean dist-prep
65 +       rm -rf ../$(PACKAGE)-$(VERSION)
66 +       mkdir ../$(PACKAGE)-$(VERSION)
67 +       ( 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 -)
68 +       ( if [ -f linguas ]; then LINGUAS=`cat linguas`; PATCH_LINGUAS="s:^LINGUAS =.*:LINGUAS = $${LINGUAS}:"; fi; cd ../$(PACKAGE)-$(VERSION) && mkdir build && cp $(BUILD)/Makefile.dpkg_ipkg $(BUILD)/Makefile.translation build/ && sed "s:^CVSBUILD =.*:CVSBUILD = no:;s:^DEBUG =.*:DEBUG = no:;s:Makefile.translation-auto-linguas:Makefile.translation:;$${PATCH_LINGUAS}" < Makefile > Makefile.new && mv Makefile.new Makefile )
69 +       ( cd .. ; tar cf - $(PACKAGE)-$(VERSION) | gzip -9 >$(PACKAGE)-$(VERSION).tar.gz )
70 +       rm -rf ../$(PACKAGE)-$(VERSION)
71 +       $(MAKE) printinfo
72 +
73 +dist-upload: dist
74 +       scp ../$(PACKAGE)-$(VERSION).tar.gz $(USER)@linuxtogo.org:/media/data/projects/gpe/source/
75 +
76 +dist-prep:
77 +ipkg-prep:
78 +install-mo:
79 +# empty, can be filled in Makefile.translation
80 +
81 +install: install-program install-mo
82 +
83 +clean-dist:
84 +       rm -rf familiar/dist familiar/dist.list
85 +
86 +clean: clean-dist
87 +
88 +check-source:
89 +       @if [ -f familiar/$(CONTROL) ] && ! grep -q '^Source:' familiar/$(CONTROL); then echo -e "\nNo Source: field in control file.  Aborting.\n"; exit 1; fi
90 +
91 +ipkg: check-source ipkg-prep clean
92 +       rm -rf familiar/dist
93 +       mkdir -p familiar/dist/CONTROL
94 +       sed 's:VERSION:$(VERSION):;s$$SOURCE$$$(SOURCE)$$' < familiar/$(CONTROL) > familiar/dist/CONTROL/control
95 +       if test -e familiar/conffiles; then install -m 644 familiar/conffiles familiar/dist/CONTROL; fi
96 +       if test -e familiar/preinst;   then install familiar/preinst   familiar/dist/CONTROL; fi
97 +       if test -e familiar/postinst;  then install familiar/postinst  familiar/dist/CONTROL; fi
98 +       if test -e familiar/prerm;     then install familiar/prerm     familiar/dist/CONTROL; fi
99 +       if test -e familiar/postrm;    then install familiar/postrm    familiar/dist/CONTROL; fi
100 +       $(MAKE) DESTDIR=`pwd`/familiar/dist PREFIX=/usr prefix=/usr DEBUG=no install-program
101 +       rm -rf familiar/dist.list
102 +       ipkg-build -o 0 -g 0 familiar/dist | sed 's/^Packaged .*into //; t 1; d; : 1; s:.*/::' >> familiar/dist.list
103 +       if [ "x$(LINGUAS)" != "x" ]; then make translation-ipkg; tr ' ' '\n' < translation-ipkgs.txt >> familiar/dist.list; fi
104 +       md5sum `cat familiar/dist.list` > $(PACKAGE)_$(VERSION).batch
105 +       rm -rf familiar/dist familiar/dist.list
106 +       $(MAKE) printinfo
107 +
108 +dpkg: dist
109 +       mkdir -p $(DEB_PATH)
110 +       ( 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 )
111 +       mkdir -p $(DEB_PATH)/$(PACKAGE)-$(VERSION)/debian
112 +       for i in debian/*; do if test -f $$i; then cp $$i $(DEB_PATH)/$(PACKAGE)-$(VERSION)/debian/; fi; done
113 +
114 +CVSTAG := $(shell echo $(PACKAGE)-$(VERSION) | tr [a-z.] [A-Z_])
115 +printinfo:
116 +       @printf '-------------------------------------------------------------------------------\n'
117 +       @printf "If this becomes a package release, please add a CVS tag.\n"
118 +       @printf "You can use 'make tag' for that, it will execute\n"
119 +       @printf "   cvs tag %s\n" $(CVSTAG)
120 +       @printf "Please upload a tarball (created with 'make dist') to\n"
121 +       @printf "   ftp://ftp.handhelds.org/pub/projects/gpe/\n"
122 +       @printf "   (handhelds.org:~ftp/pub/projects/gpe/source)\n"
123 +       @printf "You can use 'make dist-upload' to do that.\n"
124 +       @printf "You are currently known as USER %s.\n" $(USER)
125 +       @printf '-------------------------------------------------------------------------------\n'
126 +
127 +tag: check-source
128 +       cvs tag $(CVSTAG)
129 +
130 +retag: check-source
131 +       cvs tag -F $(CVSTAG)
132 +
133 +source: tag dist-upload
134 +
135 +%.pc: %.pc.in
136 +       sed 's:PREFIX:$(PREFIX):;s:BUILDDIR:$(shell pwd):;s:VERSION:$(VERSION):' < $< > $@
137 +
138 +.c.o:;
139 +       $(CC) $(CFLAGS) $(CPPFLAGS) $(PACKAGE_CFLAGS) $(PACKAGE_CPPFLAGS) -c $< -o $@
140 diff -Naur blueprobe.orig/Makefile.translation blueprobe/Makefile.translation
141 --- blueprobe.orig/Makefile.translation 1970-01-01 02:00:00.000000000 +0200
142 +++ blueprobe/Makefile.translation      2007-02-10 16:28:17.996104169 +0200
143 @@ -0,0 +1,107 @@
144 +.SUFFIXES: .mo .po .pot .po8
145 +
146 +CONTROL = `if test -e familiar/control1; then echo control1; else echo control; fi`
147 +
148 +# use ipkg-build or ipkg-deb-build
149 +IPKG_BUILD := ipkg-build
150 +
151 +TRANSLATION_SITE := http://www.iro.umontreal.ca/~gnutra/maint
152 +
153 +ifeq ($(DIR_PO),)
154 +DIR_PO := po
155 +endif
156 +
157 +ifeq ($(BINPACKAGE),)
158 +BINPACKAGE := $(PACKAGE)
159 +endif
160 +
161 +mo-files = $(patsubst %,$(DIR_PO)/%.mo,$(LINGUAS))
162 +po-files = $(patsubst %,$(DIR_PO)/%.po,$(LINGUAS))
163 +
164 +ifeq ($(shell if [ -f $(PACKAGE).desktop.in ]; then echo present; fi;),present)
165 +desktop-files += $(PACKAGE).desktop
166 +endif
167 +
168 +ifneq ($(EXTRA_DESKTOPS),)
169 +desktop-files += $(patsubst %.desktop.in,%.desktop,$(EXTRA_DESKTOPS))
170 +endif
171 +
172 +all-mo: $(mo-files)
173 +
174 +all-desktop: $(desktop-files)
175 +
176 +install-mo: all-mo
177 +       if [ "$(ENABLE_NLS)" != "no" ]; then \
178 +               if [ "x$(LINGUAS)" != "x" ]; then \
179 +                       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 \
180 +               fi; \
181 +       fi;
182 +
183 +.po8.mo:;
184 +       if [ "$(ENABLE_NLS)" != "no" ]; then \
185 +               msgfmt -o $@ $<; \
186 +       fi;
187 +
188 +.po.po8:;
189 +       CTYPE=`grep "^\"Content-Type:" $< | sed 's/^.*charset=//;s/\\\\.*//'`; sed "s/\(Content-Type: .*=\)$$CTYPE/\1UTF-8/" < $< | iconv -f $${CTYPE} -t UTF-8 >$@
190 +
191 +update-po: $(po-files) extract-po
192 +
193 +dist-prep: update-po freshen-po
194 +# empty
195 +
196 +ifeq ($(CVSBUILD),yes)
197 +ipkg-prep: freshen-po
198 +# empty
199 +endif
200 +
201 +extract-po:
202 +       mkdir -p $(DIR_PO)
203 +       ( 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 )
204 +       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
205 +
206 +clean: clean-po clean-dist-translation
207 +
208 +clean-po:
209 +       rm -rf $(DIR_PO)/*.mo
210 +       for i in $(desktop-files); do if [ -f $$i.in ]; then rm -f $$i; rm -f $$i.in.h; fi; done
211 +
212 +%.desktop: %.desktop.in $(patsubst %,$(DIR_PO)/%.po,$(LINGUAS))
213 +       intltool-merge -u -d $(DIR_PO) $< $@
214 +
215 +freshen-po:
216 +       rm -rf tmp-po
217 +       mkdir tmp-po
218 +       cd tmp-po; for LANG in $(LINGUAS); do wget $(TRANSLATION_SITE)/$(PACKAGE)/$$LANG.po; done
219 +       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
220 +       rm -rf tmp-po
221 +
222 +# ------------------------------------------------------------------------
223 +
224 +MAINTAINER = $(shell grep 'Maintainer: ' familiar/$(CONTROL) | cut -d ' ' -f 2-)
225 +
226 +ifndef BUILD
227 +BUILD = ../build
228 +endif
229 +
230 +transdist := familiar/dist-translation
231 +templates := $(BUILD)/familiar
232 +ipkglist  := translation-ipkgs.txt
233 +
234 +clean-dist-translation:
235 +       rm -rf $(transdist) $(ipkglist)
236 +
237 +real-translation-package: all-mo
238 +       rm -rf $(transdist) $(ipkglist)
239 +       for LINGUA in $(LINGUAS); do \
240 +               i=$$(echo $$LINGUA | tr '[A-Z_]' '[a-z+]'); \
241 +               mkdir -p $(transdist)/$$i/CONTROL; \
242 +               mkdir -p $(transdist)/$$i$(PREFIX)/share/locale/$$LINGUA/LC_MESSAGES; \
243 +               install -m 644 po/$$LINGUA.mo $(transdist)/$$i$(PREFIX)/share/locale/$$LINGUA/LC_MESSAGES/$(PACKAGE).mo; \
244 +               sed -e "s/<maintainer>/$(MAINTAINER)/;s/<package>/$(BINPACKAGE)/;s/<version>/$(VERSION)/;s/<language>/$$i/;s!<source>!$(SOURCE)!" $(templates)/control.translation > $(transdist)/$$i/CONTROL/control; \
245 +               install $(templates)/postinst.translation $(transdist)/$$i/CONTROL/postinst; \
246 +               $(IPKG_BUILD) -g 0 -o 0 $(transdist)/$$i | sed 's/^Packaged .*into //; t 1; d; : 1; s:.*/::' >> $(ipkglist); \
247 +       done
248 +
249 +translation-ipkg:
250 +       make PREFIX=/usr real-translation-package