View | Details | Raw Unified | Return to bug 225301 | Differences between
and this patch

Collapse All | Expand All

(-)Mk/Scripts/check-desktop-entries.sh (+111 lines)
Added Link Here
1
#!/bin/sh
2
# $FreeBSD$
3
#
4
# MAINTAINER: portmgr@FreeBSD.org
5
6
set -e
7
8
. "${dp_SCRIPTSDIR}/functions.sh"
9
10
validate_env dp_CURDIR dp_ECHO_CMD dp_ECHO_MSG dp_EXPR dp_GREP dp_PKGNAME \
11
	dp_SED dp_TR dp_MAKE
12
13
[ -n "${DEBUG_MK_SCRIPTS}" -o -n "${DEBUG_MK_SCRIPTS_CHECK_DESKTOP_ENTRIES}" ] && set -x
14
15
set -u
16
17
# http://standards.freedesktop.org/menu-spec/menu-spec-latest.html
18
DESKTOP_CATEGORIES_MAIN='AudioVideo Audio Video Development Education Game
19
Graphics Network Office Science Settings System Utility'
20
DESKTOP_CATEGORIES_ADDITIONAL='Building Debugger IDE GUIDesigner Profiling
21
RevisionControl Translation Calendar ContactManagement Database Dictionary
22
Chart Email Finance FlowChart PDA ProjectManagement Presentation Spreadsheet
23
WordProcessor 2DGraphics VectorGraphics RasterGraphics 3DGraphics Scanning OCR
24
Photography Publishing Viewer TextTools DesktopSettings HardwareSettings
25
Printing PackageManager Dialup InstantMessaging Chat IRCClient Feed
26
FileTransfer HamRadio News P2P RemoteAccess Telephony TelephonyTools
27
VideoConference WebBrowser WebDevelopment Midi Mixer Sequencer Tuner TV
28
AudioVideoEditing Player Recorder DiscBurning ActionGame AdventureGame
29
ArcadeGame BoardGame BlocksGame CardGame KidsGame LogicGame RolePlaying Shooter
30
Simulation SportsGame StrategyGame Art Construction Music Languages
31
ArtificialIntelligence Astronomy Biology Chemistry ComputerScience
32
DataVisualization Economy Electricity Geography Geology Geoscience History
33
Humanities ImageProcessing Literature Maps Math NumericalAnalysis
34
MedicalSoftware Physics Robotics Spirituality Sports ParallelComputing
35
Amusement Archiving Compression Electronics Emulator Engineering FileTools
36
FileManager TerminalEmulator Filesystem Monitor Security Accessibility
37
Calculator Clock TextEditor Documentation Adult Core KDE GNOME MATE XFCE GTK Qt
38
Motif Java ConsoleOnly'
39
DESKTOP_CATEGORIES_RESERVED='Screensaver TrayIcon Applet Shell'
40
41
VALID_DESKTOP_CATEGORIES="${dp_VALID_DESKTOP_CATEGORIES} ${DESKTOP_CATEGORIES_MAIN} ${DESKTOP_CATEGORIES_ADDITIONAL} ${DESKTOP_CATEGORIES_RESERVED}"
42
43
if [ $(${dp_EXPR} $# % 6) -ne 0 ]; then
44
	${dp_ECHO_MSG} "${dp_PKGNAME}: Makefile error: the DESKTOP_ENTRIES list must contain one or more groups of 6 elements"
45
	exit 1
46
fi
47
48
num=0
49
50
while [ $# -ge 6 ]; do
51
	num=$(${dp_EXPR} ${num} + 1)
52
	entry="#${num}"
53
54
	Name="${1}"
55
	Comment="${2}"
56
	Icon="${3}"
57
	Exec="${4}"
58
	Categories="${5}"
59
	StartupNotify="${6}"
60
61
	shift 6
62
63
	if [ -n "${Exec}" ]; then
64
		entry="${entry} (${Exec})"
65
	elif [ -n "${Name}" ]; then
66
		entry="${entry} (${Name})"
67
	fi
68
69
	if [ -z "${Name}" ]; then
70
		${dp_ECHO_MSG} "${dp_PKGNAME}: Makefile error: in desktop entry ${entry}: field 1 (Name) is empty"
71
		exit 1
72
	fi
73
74
	if ${dp_EXPR} '(' "${Icon}" : '.*\.xpm$' ')' '|' '(' ${Icon} : '.*\.png$' ')'  '|' '(' ${Icon} : '.*\.svg$' ')' > /dev/null; then
75
		if ! echo "${Icon}" | ${dp_GREP} -qe '^/' ; then
76
			${dp_ECHO_MSG} "${dp_PKGNAME}: Makefile warning: in desktop entry ${entry}: field 3 (Icon) should be either absolute path or icon name without extension if installed icons follow Icon Theme Specification"
77
		fi
78
	fi
79
80
	if [ -z "${Exec}" ]; then
81
		${dp_ECHO_MSG} "${dp_PKGNAME}: Makefile error: in desktop entry ${entry}: field 4 (Exec) is empty"
82
		exit 1
83
	fi
84
85
	if [ -n "${Categories}" ]; then
86
		for c in $(${dp_ECHO_CMD} "${Categories}" | ${dp_TR} ';' ' '); do
87
			if ! ${dp_ECHO_CMD} ${VALID_DESKTOP_CATEGORIES} | ${dp_GREP} -wq ${c}; then
88
				${dp_ECHO_CMD} "${dp_PKGNAME}: Makefile warning: in desktop entry ${entry}: category ${c} is not a valid desktop category"
89
			fi
90
		done
91
92
		if ! ${dp_ECHO_CMD} "${Categories}" | ${dp_GREP} -Eq "$(${dp_ECHO_CMD} ${DESKTOP_CATEGORIES_MAIN} | ${dp_SED} -E 's,[[:blank:]]+,\|,g')"; then
93
			${dp_ECHO_CMD} "${dp_PKGNAME}: Makefile warning: in desktop entry ${entry}: field 5 (Categories) must contain at least one main desktop category (make -VDESKTOP_CATEGORIES_MAIN)"
94
		fi
95
96
		if ! ${dp_EXPR} "${Categories}" : '.*;$' > /dev/null; then
97
			${dp_ECHO_MSG} "${dp_PKGNAME}: Makefile error: in desktop entry ${entry}: field 5 (Categories) does not end with a semicolon"
98
			exit 1
99
		fi
100
	else
101
		if [ -z "$(cd ${dp_CURDIR} && ${dp_MAKE} desktop-categories)" ]; then
102
			${dp_ECHO_MSG} "${dp_PKGNAME}: Makefile error: in desktop entry ${entry}: field 5 (Categories) is empty and could not be deduced from the CATEGORIES variable"
103
			exit 1
104
		fi
105
	fi
106
107
	if [ "${StartupNotify}" != "true" ] && [ "${StartupNotify}" != "false" ] && [ -n "${StartupNotify}" ]; then
108
		${dp_ECHO_MSG} "${dp_PKGNAME}: Makefile error: in desktop entry ${entry}: field 6 (StartupNotify) is not \"true\", \"false\" or \"\"(empty)"
109
		exit 1
110
	fi
111
done
(-)Mk/Scripts/desktop-categories.sh (+89 lines)
Added Link Here
1
#!/bin/sh
2
# $FreeBSD$
3
#
4
# MAINTAINER: portmgr@FreeBSD.org
5
6
set -e
7
8
. "${dp_SCRIPTSDIR}/functions.sh"
9
10
validate_env dp_CATEGORIES dp_SORT dp_TR dp_ECHO_CMD
11
12
[ -n "${DEBUG_MK_SCRIPTS}" -o -n "${DEBUG_MK_SCRIPTS_DESKTOP_CATEGORIES}" ] && set -x
13
14
set -u
15
16
categories=""
17
for native_category in ${dp_CATEGORIES}; do
18
	c=""
19
	case ${native_category} in
20
		accessibility)	c="Utility Accessibility"		;;
21
		archivers)	c="Utility Archiving"			;;
22
		astro)		c="Education Science Astronomy"		;;
23
		audio)		c="AudioVideo Audio"			;;
24
		benchmarks)	c="System"				;;
25
		biology)	c="Education Science Biology"		;;
26
		cad)		c="Graphics Engineering"		;;
27
		comms)		c="Utility"				;;
28
		converters)	c="Utility"				;;
29
		databases)	c="Office Database"			;;
30
		deskutils)	c="Utility"				;;
31
		devel)		c="Development"				;;
32
		dns)		c="Network"				;;
33
		elisp)		c="Development"				;;
34
		editors)	c="Utility"				;;
35
		emulators)	c="System Emulator"			;;
36
		finance)	c="Office Finance"			;;
37
		ftp)		c="Network FileTransfer"		;;
38
		games)		c="Game"				;;
39
		geography)	c="Education Science Geography"		;;
40
		gnome)		c="GNOME GTK"				;;
41
		graphics)	c="Graphics"				;;
42
		hamradio)	c="HamRadio"				;;
43
		haskell)	c="Development"				;;
44
		irc)		c="Network IRCClient"			;;
45
		java)		c="Development Java"			;;
46
		kde)		c="KDE Qt"				;;
47
		lang)		c="Development"				;;
48
		lisp)		c="Development"				;;
49
		mail)		c="Office Email"			;;
50
		mate)		c="MATE GTK"				;;
51
		math)		c="Education Science Math"		;;
52
		mbone)		c="Network AudioVideo"			;;
53
		multimedia)	c="AudioVideo"				;;
54
		net)		c="Network"				;;
55
		net-im)		c="Network InstantMessaging"		;;
56
		net-mgmt)	c="Network"				;;
57
		net-p2p)	c="Network P2P"				;;
58
		news)		c="Network News"			;;
59
		palm)		c="Office PDA"				;;
60
		parallel)	c="ParallelComputing"			;;
61
		pear)		c="Development WebDevelopment"		;;
62
		perl5)		c="Development"				;;
63
		python)		c="Development"				;;
64
		ruby)		c="Development"				;;
65
		rubygems)	c="Development"				;;
66
		scheme)		c="Development"				;;
67
		science)	c="Science Education"			;;
68
		security)	c="System Security"			;;
69
		shells)		c="System Shell"			;;
70
		sysutils)	c="System"				;;
71
		tcl*|tk*)	c="Development"				;;
72
		textproc)	c="Utility TextTools"			;;
73
		www)		c="Network"				;;
74
		x11-clocks)	c="Utility Clock"			;;
75
		x11-fm)		c="System FileManager"			;;
76
		xfce)		c="GTK XFCE"				;;
77
		zope)		c="Development WebDevelopment"		;;
78
	esac
79
	if [ -n "${c}" ]; then
80
		categories="${categories} ${c}"
81
	fi
82
done
83
84
if [ -n "${categories}" ]; then
85
	for c in ${categories}; do
86
		${dp_ECHO_CMD} "${c}"
87
	done | ${dp_SORT} -u | ${dp_TR} '\n' ';'
88
	${dp_ECHO_CMD}
89
fi
(-)Mk/Scripts/install-desktop-entries.sh (+64 lines)
Added Link Here
1
#!/bin/sh
2
# $FreeBSD$
3
#
4
# MAINTAINER: portmgr@FreeBSD.org
5
6
set -e
7
8
. "${dp_SCRIPTSDIR}/functions.sh"
9
10
validate_env dp_SED dp_ECHO_CMD dp_STAGEDIR dp_DESKTOPDIR
11
12
[ -n "${DEBUG_MK_SCRIPTS}" -o -n "${DEBUG_MK_SCRIPTS_INSTALL_DESKTOP_ENTRIES}" ] && set -x
13
14
set -u
15
16
while [ $# -ge 6 ]; do
17
18
	Name="${1}"
19
	Comment="${2}"
20
	Icon="${3}"
21
	Exec="${4}"
22
	Categories="${5}"
23
	StartupNotify="${6}"
24
25
	shift 6
26
27
	filename="$(${dp_ECHO_CMD} "${Exec}" | ${dp_SED} -e 's,^/,,g;s,[/ ],_,g;s,[^_[:alnum:]],,g').desktop"
28
29
	pathname="${dp_STAGEDIR}${dp_DESKTOPDIR}/${filename}"
30
31
	${dp_ECHO_CMD} "${dp_DESKTOPDIR}/${filename}" >> ${dp_TMPPLIST}
32
33
	${dp_ECHO_CMD} "[Desktop Entry]" > ${pathname}
34
	${dp_ECHO_CMD} "Type=Application" >> ${pathname}
35
	${dp_ECHO_CMD} "Version=1.0" >> ${pathname}
36
	${dp_ECHO_CMD} "Name=${Name}" >> ${pathname}
37
38
	if [ -n "${Comment}" ]; then
39
		comment="${Comment}"
40
	else
41
		comment="$(cd ${dp_CURDIR} && ${dp_MAKE} -VCOMMENT)"
42
	fi
43
44
	${dp_ECHO_CMD} "GenericName=${comment}" >> ${pathname}
45
	${dp_ECHO_CMD} "Comment=${comment}" >> ${pathname}
46
47
	if [ -n "${Icon}" ]; then
48
		${dp_ECHO_CMD} "Icon=${Icon}" >> ${pathname}
49
	fi
50
51
	${dp_ECHO_CMD} "Exec=${Exec}" >> ${pathname}
52
53
	if [ -n "${Categories}" ]; then
54
		categories="${Categories}"
55
	else
56
		categories="$(cd ${dp_CURDIR} && ${dp_MAKE} desktop-categories)"
57
	fi
58
59
	${dp_ECHO_CMD} "Categories=${categories}" >> ${pathname}
60
61
	if [ -n "${StartupNotify}" ]; then
62
		${dp_ECHO_CMD} "StartupNotify=${StartupNotify}" >> ${pathname}
63
	fi
64
done
(-)Mk/bsd.port.mk (-182 / +30 lines)
Lines 5074-5269 pretty-print-config: Link Here
5074
.endif # pretty-print-config
5074
.endif # pretty-print-config
5075
5075
5076
desktop-categories:
5076
desktop-categories:
5077
	@categories=""; \
5077
	@${SETENV} \
5078
	for native_category in ${CATEGORIES}; do \
5078
			dp_CATEGORIES="${CATEGORIES}" \
5079
		c=""; \
5079
			dp_ECHO_CMD=${ECHO_CMD} \
5080
		case $$native_category in \
5080
			dp_SCRIPTSDIR="${SCRIPTSDIR}" \
5081
			accessibility)	c="Utility Accessibility"		;; \
5081
			dp_SORT="${SORT}" \
5082
			archivers)		c="Utility Archiving"			;; \
5082
			dp_TR="${TR}" \
5083
			astro)			c="Education Science Astronomy"	;; \
5083
			${SH} ${SCRIPTSDIR}/desktop-categories.sh
5084
			audio)			c="AudioVideo Audio"			;; \
5085
			benchmarks)		c="System"						;; \
5086
			biology)		c="Education Science Biology"	;; \
5087
			cad)			c="Graphics Engineering"		;; \
5088
			comms)			c="Utility"						;; \
5089
			converters)		c="Utility"						;; \
5090
			databases)		c="Office Database"				;; \
5091
			deskutils)		c="Utility"						;; \
5092
			devel)			c="Development"					;; \
5093
			dns)			c="Network"						;; \
5094
			elisp)			c="Development"					;; \
5095
			editors)		c="Utility"						;; \
5096
			emulators)		c="System Emulator"				;; \
5097
			finance)		c="Office Finance"				;; \
5098
			ftp)			c="Network FileTransfer"		;; \
5099
			games)			c="Game"						;; \
5100
			geography)		c="Education Science Geography"	;; \
5101
			gnome)			c="GNOME GTK"					;; \
5102
			graphics)		c="Graphics"					;; \
5103
			hamradio)		c="HamRadio"					;; \
5104
			haskell)		c="Development"					;; \
5105
			irc)			c="Network IRCClient"			;; \
5106
			java)			c="Development Java"			;; \
5107
			kde)			c="KDE Qt"						;; \
5108
			lang)			c="Development"					;; \
5109
			lisp)			c="Development"					;; \
5110
			mail)			c="Office Email"				;; \
5111
			mate)			c="MATE GTK"		;; \
5112
			math)			c="Education Science Math"		;; \
5113
			mbone)			c="Network AudioVideo"			;; \
5114
			multimedia)		c="AudioVideo"					;; \
5115
			net)			c="Network"						;; \
5116
			net-im)			c="Network InstantMessaging"	;; \
5117
			net-mgmt)		c="Network"						;; \
5118
			net-p2p)		c="Network P2P"					;; \
5119
			news)			c="Network News"				;; \
5120
			palm)			c="Office PDA"					;; \
5121
			parallel)		c="ParallelComputing"			;; \
5122
			pear)			c="Development WebDevelopment"	;; \
5123
			perl5)			c="Development"					;; \
5124
			python)			c="Development"					;; \
5125
			ruby)			c="Development"					;; \
5126
			rubygems)		c="Development"					;; \
5127
			scheme)			c="Development"					;; \
5128
			science)		c="Science Education"			;; \
5129
			security)		c="System Security"				;; \
5130
			shells)			c="System Shell"				;; \
5131
			sysutils)		c="System"						;; \
5132
			tcl*|tk*)		c="Development"					;; \
5133
			textproc)		c="Utility TextTools"			;; \
5134
			www)			c="Network"						;; \
5135
			x11-clocks)		c="Utility Clock"				;; \
5136
			x11-fm)			c="System FileManager"			;; \
5137
			xfce)			c="GTK XFCE"					;; \
5138
			zope)			c="Development WebDevelopment"	;; \
5139
		esac; \
5140
		if [ -n "$$c" ]; then \
5141
			categories="$$categories $$c"; \
5142
		fi; \
5143
	done; \
5144
	if [ -n "$$categories" ]; then \
5145
		for c in $$categories; do ${ECHO_MSG} "$$c"; done \
5146
			| ${SORT} -u | ${TR} '\n' ';'; \
5147
		${ECHO_MSG}; \
5148
	fi
5149
5150
# http://standards.freedesktop.org/menu-spec/menu-spec-latest.html
5151
DESKTOP_CATEGORIES_MAIN=	AudioVideo Audio Video Development Education \
5152
	Game Graphics Network Office Science Settings System Utility
5153
DESKTOP_CATEGORIES_ADDITIONAL=	Building Debugger IDE GUIDesigner Profiling \
5154
	RevisionControl Translation Calendar ContactManagement Database \
5155
	Dictionary Chart Email Finance FlowChart PDA ProjectManagement \
5156
	Presentation Spreadsheet WordProcessor 2DGraphics VectorGraphics \
5157
	RasterGraphics 3DGraphics Scanning OCR Photography Publishing Viewer \
5158
	TextTools DesktopSettings HardwareSettings Printing PackageManager \
5159
	Dialup InstantMessaging Chat IRCClient Feed FileTransfer HamRadio News \
5160
	P2P RemoteAccess Telephony TelephonyTools VideoConference WebBrowser \
5161
	WebDevelopment Midi Mixer Sequencer Tuner TV AudioVideoEditing Player \
5162
	Recorder DiscBurning ActionGame AdventureGame ArcadeGame BoardGame \
5163
	BlocksGame CardGame KidsGame LogicGame RolePlaying Shooter Simulation \
5164
	SportsGame StrategyGame Art Construction Music Languages \
5165
	ArtificialIntelligence Astronomy Biology Chemistry ComputerScience \
5166
	DataVisualization Economy Electricity Geography Geology Geoscience \
5167
	History Humanities ImageProcessing Literature Maps Math \
5168
	NumericalAnalysis MedicalSoftware Physics Robotics Spirituality Sports \
5169
	ParallelComputing Amusement Archiving Compression Electronics Emulator \
5170
	Engineering FileTools FileManager TerminalEmulator Filesystem Monitor \
5171
	Security Accessibility Calculator Clock TextEditor Documentation Adult \
5172
	Core KDE GNOME MATE XFCE GTK Qt Motif Java ConsoleOnly
5173
DESKTOP_CATEGORIES_RESERVED=	Screensaver TrayIcon Applet Shell
5174
5175
VALID_DESKTOP_CATEGORIES+=	${DESKTOP_CATEGORIES_MAIN} \
5176
	${DESKTOP_CATEGORIES_ADDITIONAL} \
5177
	${DESKTOP_CATEGORIES_RESERVED}
5178
5084
5179
.if defined(DESKTOP_ENTRIES)
5085
.if defined(DESKTOP_ENTRIES)
5180
check-desktop-entries:
5086
check-desktop-entries:
5181
	@set -- ${DESKTOP_ENTRIES} XXX; \
5087
	@${SETENV} \
5182
	if [ `${EXPR} \( $$# - 1 \) % 6` -ne 0 ]; then \
5088
			dp_CURDIR="${.CURDIR}" \
5183
		${ECHO_MSG} "${PKGNAME}: Makefile error: the DESKTOP_ENTRIES list must contain one or more groups of 6 elements"; \
5089
			dp_ECHO_CMD=${ECHO_CMD} \
5184
		exit 1; \
5090
			dp_ECHO_MSG=${ECHO_MSG} \
5185
	fi; \
5091
			dp_EXPR="${EXPR}" \
5186
	num=1; \
5092
			dp_GREP="${GREP}" \
5187
	while [ $$# -gt 6 ]; do \
5093
			dp_MAKE="${MAKE}" \
5188
		entry="#$$num"; \
5094
			dp_PKGNAME="${PKGNAME}" \
5189
		if [ -n "$$4" ]; then \
5095
			dp_SCRIPTSDIR="${SCRIPTSDIR}" \
5190
			entry="$$entry ($$4)"; \
5096
			dp_SED="${SED}" \
5191
		elif [ -n "$$1" ]; then \
5097
			dp_VALID_DESKTOP_CATEGORIES="${VALID_DESKTOP_CATEGORIES}" \
5192
			entry="$$entry ($$1)"; \
5098
			dp_TR="${TR}" \
5193
		fi; \
5099
			${SH} ${SCRIPTSDIR}/check-desktop-entries.sh ${DESKTOP_ENTRIES}
5194
		if [ -z "$$1" ]; then \
5195
			${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 1 (Name) is empty"; \
5196
			exit 1; \
5197
		fi; \
5198
		if ${ECHO_CMD} "$$3" | ${EGREP} -iq '.(png|svg|xpm)$$'; then \
5199
			if ! ${ECHO_CMD} "$$3" | ${GREP} -iq '^/'; then \
5200
				${ECHO_MSG} "${PKGNAME}: Makefile warning: in desktop entry $$entry: field 3 (Icon) should be either absolute path or icon name without extension if installed icons follow Icon Theme Specification"; \
5201
			fi; \
5202
		fi; \
5203
		if [ -z "$$4" ]; then \
5204
			${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 4 (Exec) is empty"; \
5205
			exit 1; \
5206
		fi; \
5207
		if [ -n "$$5" ]; then \
5208
			for c in `${ECHO_CMD} "$$5" | ${TR} ';' ' '`; do \
5209
				if ! ${ECHO_CMD} ${VALID_DESKTOP_CATEGORIES} | ${GREP} -wq $$c; then \
5210
					${ECHO_CMD} "${PKGNAME}: Makefile warning: in desktop entry $$entry: category $$c is not a valid desktop category"; \
5211
				fi; \
5212
			done; \
5213
			if ! ${ECHO_CMD} "$$5" | ${GREP} -q "`${ECHO_CMD} ${DESKTOP_CATEGORIES_MAIN} | ${SED} -E 's,[[:blank:]]+,\\\|,g'`"; then \
5214
				${ECHO_CMD} "${PKGNAME}: Makefile warning: in desktop entry $$entry: field 5 (Categories) must contain at least one main desktop category (make -VDESKTOP_CATEGORIES_MAIN)"; \
5215
			fi; \
5216
			if ! ${ECHO_CMD} "$$5" | ${GREP} -q ';$$'; then \
5217
				${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 5 (Categories) does not end with a semicolon"; \
5218
				exit 1; \
5219
			fi; \
5220
		else \
5221
			if [ -z "`cd ${.CURDIR} && ${MAKE} desktop-categories`" ]; then \
5222
				${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 5 (Categories) is empty and could not be deduced from the CATEGORIES variable"; \
5223
				exit 1; \
5224
			fi; \
5225
		fi; \
5226
		if [ "x$$6" != "xtrue" ] && [ "x$$6" != "xfalse" ] && [ "x$$6" != "x" ]; then \
5227
			${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 6 (StartupNotify) is not \"true\", \"false\" or \"\"(empty)"; \
5228
			exit 1; \
5229
		fi; \
5230
		shift 6; \
5231
		num=`${EXPR} $$num + 1`; \
5232
	done
5233
.endif
5100
.endif
5234
5101
5235
.if !target(install-desktop-entries)
5102
.if !target(install-desktop-entries)
5236
.if defined(DESKTOP_ENTRIES)
5103
.if defined(DESKTOP_ENTRIES)
5237
install-desktop-entries:
5104
install-desktop-entries:
5238
	@set -- ${DESKTOP_ENTRIES} XXX; \
5105
	@${SETENV} \
5239
	while [ $$# -gt 6 ]; do \
5106
			dp_CURDIR="${.CURDIR}" \
5240
		filename="`${ECHO_CMD} "$$4" | ${SED} -e 's,^/,,g;s,[/ ],_,g;s,[^_[:alnum:]],,g'`.desktop"; \
5107
			dp_ECHO_CMD=${ECHO_CMD} \
5241
		pathname="${STAGEDIR}${DESKTOPDIR}/$$filename"; \
5108
			dp_SCRIPTSDIR="${SCRIPTSDIR}" \
5242
		categories="$$5"; \
5109
			dp_STAGEDIR="${STAGEDIR}" \
5243
		if [ -z "$$categories" ]; then \
5110
			dp_DESKTOPDIR="${DESKTOPDIR}" \
5244
			categories="`cd ${.CURDIR} && ${MAKE} desktop-categories`"; \
5111
			dp_TMPPLIST="${TMPPLIST}" \
5245
		fi; \
5112
			dp_MAKE="${MAKE}" \
5246
		${ECHO_CMD} "${DESKTOPDIR}/$$filename" >> ${TMPPLIST}; \
5113
			dp_SED="${SED}" \
5247
		${ECHO_CMD} "[Desktop Entry]" > $$pathname; \
5114
			${SH} ${SCRIPTSDIR}/install-desktop-entries.sh ${DESKTOP_ENTRIES}
5248
		${ECHO_CMD} "Type=Application" >> $$pathname; \
5249
		${ECHO_CMD} "Version=1.0" >> $$pathname; \
5250
		${ECHO_CMD} "Name=$$1" >> $$pathname; \
5251
		comment="$$2"; \
5252
		if [ -z "$$2" ]; then \
5253
			comment="`cd ${.CURDIR} && ${MAKE} -VCOMMENT`"; \
5254
		fi; \
5255
		${ECHO_CMD} "GenericName=$$comment" >> $$pathname; \
5256
		${ECHO_CMD} "Comment=$$comment" >> $$pathname; \
5257
		if [ -n "$$3" ]; then \
5258
			${ECHO_CMD} "Icon=$$3" >> $$pathname; \
5259
		fi; \
5260
		${ECHO_CMD} "Exec=$$4" >> $$pathname; \
5261
		${ECHO_CMD} "Categories=$$categories" >> $$pathname; \
5262
		if [ -n "$$6" ]; then \
5263
			${ECHO_CMD} "StartupNotify=$$6" >> $$pathname; \
5264
		fi; \
5265
		shift 6; \
5266
	done
5267
.endif
5115
.endif
5268
.endif
5116
.endif
5269
5117

Return to bug 225301