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=slackware
28
29# --- Settings -----------------------------------------------------
30
31.INCLUDE :  settings.mk
32
33# --- Product Version Information ----------------------------------
34
35.INCLUDE :  ../productversion.mk
36
37# --- Files --------------------------------------------------------
38
39MENUFILES=$(PKGDIR)$/{$(PRODUCTLIST)}4.2-$(TARGET)-menus-$(PKGVERSION)-noarch-$(PKGREV).tgz
40
41# --- Targets -------------------------------------------------------
42
43.INCLUDE :  target.mk
44
45.IF "$(OS)" == "LINUX"
46
47ALLTAR : $(MENUFILES)
48
49$(MISC)/$(TARGET)/usr/share/applications/ :
50	@$(MKDIRHIER) $(@)
51
52# --- slackware-specific stuff ------------------------------------
53# symlinks shall not be included in the tarball, but created with the doinst-script
54
55# FIXME: removal of *-extension.* only to create identical packages to OOF680
56%/usr/share/applications :
57	@$(MKDIRHIER) $@
58	/bin/sh -c "cd $(COMMONMISC)$/$(*:b:s/-/ /:1:s/4.2//); DESTDIR=$(shell @cd $*; pwd) GNOMEDIR="" ICON_PREFIX=$(ICONPREFIX.$(*:b:s/-/ /:1:s/4.2//)) KDEMAINDIR=/opt/kde .$/create_tree.sh"
59	$(RM) $*$/opt$/kde$/share$/icons$/*$/*$/*$/*-extension.png
60	$(RM) $*$/opt$/kde$/share$/mimelnk$/application$/*-extension.desktop
61	$(RM) $*$/usr$/share$/applications$/*.desktop
62	$(RM) $*$/usr$/bin$/soffice
63
64%$/install$/doinst.sh : update-script
65	@echo "( cd etc ; rm -rf $(UNIXFILENAME.$(*:b:s/-/ /:1:s/4.2//)) )" > $@
66	@echo "( cd etc ; ln -snf /opt/$(UNIXFILENAME.$(*:b:s/-/ /:1:s/4.2//):s/-//) $(UNIXFILENAME.$(*:b:s/-/ /:1:s/4.2//)) )" >> $@
67	@echo "( cd usr/bin ; rm -rf soffice )" >> $@
68	@echo "( cd usr/bin ; ln -sf /etc/$(UNIXFILENAME.$(*:b:s/-/ /:1:s/4.2//))/program/soffice soffice )" >> $@
69	@echo -e $(foreach,i,$(shell @cat $(COMMONMISC)$/$(*:b:s/-/ /:1:s/4.2//)/launcherlist) "\n( cd usr/share/applications ; rm -rf $(UNIXFILENAME.$(*:b:s/-/ /:1:s/4.2//))-$i )\n( cd usr/share/applications ; ln -sf /etc/$(UNIXFILENAME.$(*:b:s/-/ /:1:s/4.2//))/share/xdg/$i $(UNIXFILENAME.$(*:b:s/-/ /:1:s/4.2//))-$i )") >> $@
70	@cat $< >> $@
71
72%$/install$/slack-desc : slack-desc
73	@$(MKDIRHIER) $(@:d)
74	@sed -e "s/PKGNAME/$(*:b:s/-/ /:1:s/4.2//)-$(TARGET)-menus/g" -e "s/PKGVERSION/$(PKGVERSION.$(*:b:s/-/ /:1:s/4.2//))/g" \
75		-e "s/LONGPRODUCTNAME/$(PRODUCTNAME.$(*:b:s/-/ /:1:s/4.2//)) $(PRODUCTVERSION.$(*:b:s/-/ /:1:s/4.2//))/g" \
76		-e "s/PRODUCTNAME/$(PRODUCTNAME.$(*:b:s/-/ /:1:s/4.2//))/g" \
77		-e "s/UNIXFILENAME/$(UNIXFILENAME.$(*:b:s/-/ /:1:s/4.2//))/g" $< > $@
78
79# needed to satisfy the slackware package tools - they need
80# the entries like this
81#       ./              <- very important
82#       directory/file
83# the following does not work (no description found then):
84#       ./
85#       ./directory/file
86# and this doesn't work either (broken file-list, package cannot be removed)
87#       directory/file
88
89$(MISC)/$(TARGET)/empty.tar :
90	@$(MKDIRHIER) $(@:d)/empty
91	@tar -C $(MISC)/$(TARGET)/empty --owner=root --group=root --same-owner -cf $@ .
92
93
94# --- packaging ---------------------------------------------------
95
96$(MENUFILES) : makefile.mk slack-desc update-script $(COMMONMISC)$/{$(PRODUCTLIST)}$/build.flag
97$(MENUFILES) : $(MISC)/$(TARGET)/empty.tar
98	@-$(MKDIRHIER) $(@:d)
99	-$(RM) $(@:d)$/$(@:b:s/-/ /:1)-$(TARGET)-menus-*.tgz
100	-$(RM) -r $(MISC)$/$(@:b)
101	dmake $(MISC)$/$(@:b)$/usr/share/applications $(MISC)$/$(@:b)$/install$/slack-desc $(MISC)$/$(@:b)$/install$/doinst.sh
102	@$(COPY) $(MISC)/$(TARGET)$/empty.tar $@.tmp
103	@tar -C $(MISC)/$(@:b) --owner=root --group=root --same-owner --exclude application.flag -rf $@.tmp install usr opt
104	@gzip < $@.tmp > $@
105	@$(RM) $@.tmp
106	$(RM) -r $(MISC)$/$(@:b)
107
108.ENDIF
109