Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/Makefile.in
blob: 04ff4e33524176e3e5546fc236f60230b1b9a938 (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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
# ROOT is added when building RPM

prefix = $(ROOT)@prefix@
exec_prefix = @exec_prefix@
datarootdir = @datarootdir@
datadir = @datadir@
bindir = @bindir@

default: Makefile Content Content/locale

configure: configure.ac
	autoconf

Makefile: $(wildcard *.in) configure etoys.spec
	./autogen.sh --prefix=@prefix@

# synchronize translation

pos=$(wildcard po-new/etoys/*.po)

translation: Content/locale

Content/locale: Content $(pos)
	for dir in po-new/* ; do \
		lang=`basename $$dir` ; \
		for po in $$dir/*.po ; do \
			[ $$lang = templates ] && break ; \
			domain=`basename $$po .po`; \
			echo -n "$${lang}-$${domain}: "  ; \
			mkdir -p $@/$$lang/LC_MESSAGES ; \
			msgfmt -v -o $@/$$lang/LC_MESSAGES/$$domain.mo $$po ; \
		done \
	done
	touch $@

# install regular etoys

content_url = http://etoys.squeak.org/svn/trunk/Etoys
po_url = http://etoys.squeak.org/svn/trunk/po
content_rev = $(shell cat Content.revision)
content_host = $(shell svn info Content 2>/dev/null | grep ^URL | sed 's,.*//,,;s,/.*,,')

Content: Content.revision
	if [ "$(content_host)" = "etoys.laptop.org" ] ; then \
		mv Content Content-old ; \
	fi
	if [ ! -d Content ] ; \
	then svn checkout -r $(content_rev) $(content_url) Content ; \
	     svn checkout -r $(content_rev) $(po_url) po-new ; \
	else svn update -r $(content_rev) Content ; \
	     svn update -r $(content_rev) po-new ; \
	fi
	touch $@ -r $<

ChangeLog: Content
	./mkChangeLog

etoys = Content/etoys.image     \
	Content/etoys.changes \
	Content/EtoysV4.stc \
	$(wildcard Content/*.pr)

examples = $(wildcard \
	Content/ExampleEtoys/*.pr  \
	Content/ExampleEtoys/*.gif \
	Content/ExampleEtoys/*.ogg)

docs = README INSTALL LICENSE NOTICE ChangeLog Content/NEWS

etoysdir = $(datadir)/etoys
mimedir  = $(datadir)/mime/packages
exmpldir = $(etoysdir)/ExampleEtoys
docsdir = $(datadir)/doc/etoys
dirs = $(bindir) $(etoysdir) $(mimedir) $(exmpldir) $(docsdir)

install-etoys: Content 
	for d in $(dirs) ; do mkdir -p $$d ; done
	install -v etoys $(bindir)
	for f in $(etoys) ; do install -v -m 644 $$f $(etoysdir); done
	for f in $(examples); do install -v -m 644 $$f $(exmpldir); done
	for f in Content/locale/*/*/*.sexp.data.gz ; do \
		dir=`dirname $$f|sed 's/^Content.//'` ; \
		mkdir -p $(etoysdir)/$$dir ; \
		dest=$(etoysdir)/$$dir/`basename $$f` ; \
		echo -n $$dest; \
		( gunzip -c $$f | gzip -v --rsyncable > $$dest ); \
		chmod 644 $$dest; \
	done
	for f in Content/locale/*/*/index.txt ; do \
		dir=`dirname $$f|sed 's/^Content.//'` ; \
		mkdir -p $(etoysdir)/$$dir ; \
		install -v -m 644 $$f $(etoysdir)/$$dir ; \
	done
	for f in $(docs) ; do install -v -m 644 $$f $(docsdir); done
	for f in Content/locale/*/*/*.mo ; do \
		dir=`dirname $$f|sed 's/^Content.//'` ; \
		mkdir -p $(etoysdir)/$$dir ; \
		install -v -m 644 $$f $(etoysdir)/$$dir ; \
	done
	install -v -m 644 etoys.xml $(mimedir)


# install activity - only used from sugar-jhbuild

activitydir = $(datadir)/sugar/activities/Etoys.activity
activityfiles = NEWS COPYING.activity etoys-activity
activitymeta = activity.info activity-etoys.svg
activityall = $(activityfiles) $(activitymeta)
activityicons = $(shell grep ^mime_types activity.info|tr ' ;/' '\n\n-'|grep squeak)

install-activity: $(activityall)
	mkdir -p $(activitydir)/activity
	mkdir -p $(activitydir)/bin
	install -v etoys-activity $(activitydir)/bin
	rm -f $(activitydir)/etoys-activity
	install -v setup.py $(activitydir)
	install -v -m 644 NEWS $(activitydir)
	install -v -m 644 COPYING.activity $(activitydir)/COPYING
	install -v -m 644 activity.info $(activitydir)/activity
	install -v -m 644 activity-etoys.svg $(activitydir)/activity
	for f in $(activityicons) ; do \
		ln -sf activity-etoys.svg $(activitydir)/activity/$$f.svg ; \
	done


# install both, etoys and activity.
# RPM uses install-etoys only, and runs update-mime as post script

install: install-etoys install-activity
	update-mime-database $(datadir)/mime

check:
	@echo SKIPPED: No tests defined for Etoys

# build .xo bundle - invoke "make xo" manually 

xo_version = @ACTIVITY_VERSION@

Etoys.activity: $(activityall)
	rm -rf $@/*
	$(MAKE) activitydir=$@ install-activity

Etoys-$(xo_version).xo: Etoys.activity
	rm -f $</MANIFEST
	find $< -type f -o -type l| sed 's|^[^/]*/||' > MANIFEST
	mv MANIFEST $</
	./mkDist.py

xo: Etoys-$(xo_version).xo

# stuff below for maintainer, only invoked manually

run:
	$(bindir)/etoys	

etoys-kill:
	-(ps ax|egrep '[s]queak.*etoys.image' |sed 's/[^ 0-9].*//'|xargs -r kill)

etoys-rebuild: etoys-kill
	cp $(etoysdir)/etoys.image Content/
	cp $(etoysdir)/etoys.changes Content/
	./autogen.sh --prefix=@prefix@
	make
	make install

etoys_ver = $(shell rpm -q --queryformat '%{VERSION}' --specfile etoys.spec)

etoys-src: Content Content/locale ChangeLog configure
	-rm -rf etoys-$(etoys_ver) etoys-$(etoys_ver).tar.gz
	mkdir etoys-$(etoys_ver)
	tar cf - --no-recursion `git ls-files|grep -v ^po/` \
		`svn ls -R Content|sed s@^@Content/@` \
		`svn ls -R po-new|sed s@^@po-new/@` \
		configure \
		| tar xf - -C etoys-$(etoys_ver)
	tar cvzf etoys-$(etoys_ver).tar.gz etoys-$(etoys_ver)
	-rm -rf etoys-$(etoys_ver)

etoys_rpm = $(shell rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}' --specfile etoys.spec)
rpm_build = $(shell rpmbuild -E '%_topdir' etoys.spec 2>/dev/null)

etoys-rpm:
	ln etoys-$(etoys_ver).tar.gz $(rpm_build)/SOURCES/
	rpmbuild -ba etoys.spec

etoys-release:
	scp $(rpm_build)/RPMS/noarch/$(etoys_rpm).noarch.rpm \
	    $(rpm_build)/SRPMS/$(etoys_rpm).src.rpm \
            tinlizzie.org:/var/www/tinlizzie/olpc/sugar/rpm/
	scp $(rpm_build)/BUILD/etoys-$(etoys_ver)/etoys.spec \
	    tinlizzie.org:/var/www/tinlizzie/olpc/sugar/rpm/$(etoys_rpm).spec


xo-release:  Etoys-$(xo_version).xo
	scp $< tinlizzie.org:/var/www/tinlizzie/olpc/sugar/xo/


upload-to-laptop-org:
	scp $(rpm_build)/RPMS/noarch/$(etoys_rpm).noarch.rpm \
	    dev.laptop.org:/var/www/etoys/rpms/
	scp $(rpm_build)/SRPMS/$(etoys_rpm).src.rpm \
	    dev.laptop.org:/var/www/etoys/srpm/
	scp $(rpm_build)/BUILD/etoys-$(etoys_ver)/etoys.spec \
	    dev.laptop.org:/var/www/etoys/srpm/$(etoys_rpm).spec
	scp $< dev.laptop.org:/var/www/etoys/rpms/