xref: /aoo41x/main/sysui/desktop/debian/makefile.mk (revision 04229760)
1#**************************************************************
2#
3#  Licensed to the Apache Software Foundation (ASF) under one
4#  or more contributor license agreements.  See the NOTICE file
5#  distributed with this work for additional information
6#  regarding copyright ownership.  The ASF licenses this file
7#  to you under the Apache License, Version 2.0 (the
8#  "License"); you may not use this file except in compliance
9#  with the License.  You may obtain a copy of the License at
10#
11#    http://www.apache.org/licenses/LICENSE-2.0
12#
13#  Unless required by applicable law or agreed to in writing,
14#  software distributed under the License is distributed on an
15#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16#  KIND, either express or implied.  See the License for the
17#  specific language governing permissions and limitations
18#  under the License.
19#
20#**************************************************************
21
22
23
24PRJ=..$/..
25
26PRJNAME=sysui
27TARGET=debian
28
29# !!! FIXME !!!
30# debian-menus file.
31
32# --- Settings -----------------------------------------------------
33
34.INCLUDE :  settings.mk
35
36# --- Product Version Information ----------------------------------
37
38.INCLUDE :  ../productversion.mk
39
40# --- Files --------------------------------------------------------
41
42.IF "$(PKGFORMAT)"!="$(PKGFORMAT:s/deb//)"
43
44DEBFILES=$(foreach,i,{$(PRODUCTLIST)} $(PKGDIR)$/$i4.1-$(TARGET)-menus_$(PKGVERSION.$i)-$(PKGREV)_all.deb)
45
46.ENDIF
47
48.IF "$(FAKEROOT)"!=""
49FAKEROOT2="$(FAKEROOT)"
50.ELSE
51FAKEROOT2="LD_PRELOAD=$(SOLARBINDIR)/getuid.so"
52.ENDIF
53
54# --- Targets -------------------------------------------------------
55
56.INCLUDE :  target.mk
57
58.IF "$(PKGFORMAT)"!="$(PKGFORMAT:s/deb//)"
59
60ALLTAR : $(DEBFILES)
61
62
63%/DEBIAN/control : $$(@:f)
64	@$(MKDIRHIER) $(@:d) $*$/etc $*$/usr/share/applnk/Office $*$/usr/lib/menu
65	ln -sf /opt/$(UNIXFILENAME.$(*:f:s/-/ /:1:s/4.1//)) $*$/etc$/
66	/bin/sh -c -x "cd $(COMMONMISC)$/$(*:f:s/-/ /:1:s/4.1//) && DESTDIR=$(shell @cd $*; pwd) ICON_PREFIX=$(ICONPREFIX) KDEMAINDIR=/usr GNOMEDIR=/usr create_tree.sh"
67        @cat openoffice.org-debian-menus | sed -e 's/%PRODUCTNAME/$(PRODUCTNAME.$(*:f:s/-/ /:1:s/4.1//)) $(PRODUCTVERSION.$(*:f:s/-/ /:1:s/4.1//))/' -e 's/%PREFIX/$(UNIXFILENAME.$(*:f:s/-/ /:1:s/4.1//))/' -e 's/%ICONPREFIX/$(ICONPREFIX.$(*:f:s/-/ /:1:s/4.1//))/' > $*$/usr/lib/menu/$(*:f:s/_/ /:1:s/4.1//)
68	echo "Package: $(*:f:s/_/ /:1:s/4.1//)" > $@
69	cat $(@:f) | tr -d "\015" | sed "s/%productname/$(PRODUCTNAME.$(*:f:s/-/ /:1:s/4.1//))/" >> $@
70	echo "Version: $(PKGVERSION.$(*:f:s/-/ /:1:s/4.1//))-$(PKGREV)" >> $@
71	@du -k -s $* | awk -F ' ' '{ printf "Installed-Size: %s\n", $$1 ; }' >> $@
72
73%/DEBIAN/postinst : $$(@:f)
74	 @cat $< | tr -d "\015" | sed -e "s/%PREFIX/$(UNIXFILENAME.$(*:f:s/-/ /:1:s/4.1//))/g" > $@
75
76%/DEBIAN/postrm : $$(@:f)
77	 @cat $< | tr -d "\015" | sed -e "s/%PREFIX/$(UNIXFILENAME.$(*:f:s/-/ /:1:s/4.1//))/g" > $@
78
79%/DEBIAN/prerm : $$(@:f)
80	 @cat $< | tr -d "\015" | sed -e "s/%PREFIX/$(UNIXFILENAME.$(*:f:s/-/ /:1:s/4.1//))/g" > $@
81
82# --- packaging ---------------------------------------------------
83
84# getuid.so fakes the user/group for us
85$(DEBFILES) : $(COMMONMISC)$/{$(PRODUCTLIST)}$/build.flag
86$(DEBFILES) : makefile.mk control postinst postrm prerm
87	-$(RM) $(@:d)$(@:f:s/_/ /:1)_*
88	$(RM) -r $(MISC)$/$(@:b)
89	dmake $(MISC)$/$(@:b)$/DEBIAN$/{control postinst postrm prerm}
90	@chmod -R o-w $(MISC)$/$(@:b)
91	@chmod a+rx $(MISC)$/$(@:b)$/DEBIAN $(MISC)/$(@:b)/DEBIAN/post* $(MISC)/$(@:b)/DEBIAN/pre*
92	@chmod g-s $(MISC)/$(@:b)/DEBIAN
93	@mkdir -p $(PKGDIR)
94	/bin/bash -c "$(FAKEROOT2) dpkg-deb --build $(MISC)/$(@:b) $@"
95	$(RM) -r $(MISC)$/$(@:b)
96#	@chmod -R g+w $(MISC)/$(TARGET)/$(DEBFILE:f)
97
98.ENDIF
99