xref: /aoo42x/main/sysui/desktop/debian/makefile.mk (revision 4f913391)
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.0-$(TARGET)-menus_$(PKGVERSION.$i)-$(PKGREV)_all.deb)
45
46.ENDIF
47
48# --- Targets -------------------------------------------------------
49
50.INCLUDE :  target.mk
51
52.IF "$(PKGFORMAT)"!="$(PKGFORMAT:s/deb//)"
53
54ALLTAR : $(DEBFILES)
55
56
57%/DEBIAN/control : $$(@:f)
58	@$(MKDIRHIER) $(@:d) $*$/etc $*$/usr/share/applnk/Office $*$/usr/lib/menu
59	ln -sf /opt/$(UNIXFILENAME.$(*:f:s/-/ /:1:s/4.0//)) $*$/etc$/
60	/bin/sh -c -x "cd $(COMMONMISC)$/$(*:f:s/-/ /:1:s/4.0//) && DESTDIR=$(shell @cd $*; pwd) ICON_PREFIX=$(ICONPREFIX) KDEMAINDIR=/usr GNOMEDIR=/usr create_tree.sh"
61        @cat openoffice.org-debian-menus | sed -e 's/%PRODUCTNAME/$(PRODUCTNAME.$(*:f:s/-/ /:1:s/4.0//)) $(PRODUCTVERSION.$(*:f:s/-/ /:1:s/4.0//))/' -e 's/%PREFIX/$(UNIXFILENAME.$(*:f:s/-/ /:1:s/4.0//))/' -e 's/%ICONPREFIX/$(ICONPREFIX.$(*:f:s/-/ /:1:s/4.0//))/' > $*$/usr/lib/menu/$(*:f:s/_/ /:1:s/4.0//)
62	echo "Package: $(*:f:s/_/ /:1:s/4.0//)" > $@
63	cat $(@:f) | tr -d "\015" | sed "s/%productname/$(PRODUCTNAME.$(*:f:s/-/ /:1:s/4.0//))/" >> $@
64	echo "Version: $(PKGVERSION.$(*:f:s/-/ /:1:s/4.0//))-$(PKGREV)" >> $@
65	@du -k -s $* | awk -F ' ' '{ printf "Installed-Size: %s\n", $$1 ; }' >> $@
66
67%/DEBIAN/postinst : $$(@:f)
68	 @cat $< | tr -d "\015" | sed -e "s/%PREFIX/$(UNIXFILENAME.$(*:f:s/-/ /:1:s/4.0//))/g" > $@
69
70%/DEBIAN/postrm : $$(@:f)
71	 @cat $< | tr -d "\015" | sed -e "s/%PREFIX/$(UNIXFILENAME.$(*:f:s/-/ /:1:s/4.0//))/g" > $@
72
73%/DEBIAN/prerm : $$(@:f)
74	 @cat $< | tr -d "\015" | sed -e "s/%PREFIX/$(UNIXFILENAME.$(*:f:s/-/ /:1:s/4.0//))/g" > $@
75
76# --- packaging ---------------------------------------------------
77
78# getuid.so fakes the user/group for us
79$(DEBFILES) : $(COMMONMISC)$/{$(PRODUCTLIST)}$/build.flag
80$(DEBFILES) : makefile.mk control postinst postrm prerm
81	-$(RM) $(@:d)$(@:f:s/_/ /:1)_*
82	$(RM) -r $(MISC)$/$(@:b)
83	dmake $(MISC)$/$(@:b)$/DEBIAN$/{control postinst postrm prerm}
84	@chmod -R o-w $(MISC)$/$(@:b)
85	@chmod a+rx $(MISC)$/$(@:b)$/DEBIAN $(MISC)/$(@:b)/DEBIAN/post* $(MISC)/$(@:b)/DEBIAN/pre*
86	@chmod g-s $(MISC)/$(@:b)/DEBIAN
87	@mkdir -p $(PKGDIR)
88	/bin/bash -c "LD_PRELOAD=$(SOLARBINDIR)/getuid.so dpkg-deb --build $(MISC)/$(@:b) $@"
89	$(RM) -r $(MISC)$/$(@:b)
90#	@chmod -R g+w $(MISC)/$(TARGET)/$(DEBFILE:f)
91
92.ENDIF
93