Description: dynamically generate scribus.desktop and scribus.appdata.xml appending TAG_VERSION
 this makes .desktop and .appdata.xml use the right binary, icon, etc if
 -DCUSTOM-VERSIONTAG has been used.  Also rename the files so they can be
 coinstalled with other scribus built done with different -DCUSTOM-VERSIONTAG
Author: Mattia Rizzolo <mattia@debian.org>
Forwarded: no
Last-Updated: 2016-08-06

--- /dev/null
+++ b/scribus.desktop.in
@@ -0,0 +1,109 @@
+[Desktop Entry]
+Type=Application
+Name=Scribus
+Name[ar]=سكريبس
+Name[fa]=اسکریباس
+Name[lo]=ສະຄຣີບັດສ໌
+Name[ru]=Scribus
+Name[ta]=ஸ்கிரிபஸ்
+Comment=Page Layout and Publication
+Comment[ar]=سكريبس
+Comment[fa]=اسکریباس
+Comment[ta]=ஸ்கிரிபஸ்
+Comment[af]=Werkskerm Publisering
+Comment[bg]=Издателска програма
+Comment[bs]=Stono izdavaštvo (DTP)
+Comment[ca]=Publicació d'escriptori
+Comment[cs]=Publikační systém (DTP)
+Comment[cy]=Cyhoeddi Penbwrdd
+Comment[da]=Dtp
+Comment[eo]=DTP-programo
+Comment[es]=Publicación de escritorio
+Comment[et]=Küljendusrakendus
+Comment[fi]=Julkaisuohjelma
+Comment[fr]=Publication assistée par ordinateur (PAO)
+Comment[he]=הוצאה לאור שולחנית
+Comment[hr]=Stolno izdavaštvo
+Comment[hu]=Kiadványszerkesztés
+Comment[it]=Pubblicazioni
+Comment[ja]=デスクトップパブリッシング
+Comment[lo]=ເດດທອບພັລບບີດຊິງ
+Comment[lt]=Darbastalio leidykla
+Comment[nb]=Datatrykkeprogram
+Comment[nn]=Datatrykk
+Comment[nso]=Kwalakwatso ya Desktop
+Comment[pl]=Program do składu tekstu
+Comment[pt]=Publicação no Ecrã
+Comment[pt_BR]=Publicação do Ambiente de Trabalho
+Comment[ru]=Настольное издательство
+Comment[sl]=Namizno založništvo
+Comment[sr]=Стоно издаваштво
+Comment[ss]=Kushicelela ku desktop
+Comment[sv]=Desktop Publishing
+Comment[th]=เดสก์ทอปพับลิชชิง
+Comment[tr]=Masaüstü Yayıncılık
+Comment[uk]=Видавнича система
+Comment[uz]=Кичик нашриёт
+Comment[ven]=U andadza Desikithopo
+Comment[xh]=Upapasho lwe Desktop
+Comment[zh_CN]=桌面出版
+Comment[zh_TW]=桌面出版
+Comment[zu]=Ukushicilelwa kwe-Desktop
+GenericName=Page Layout (Development)
+GenericName[af]=Werkskerm Publisering
+GenericName[bg]=Издателска програма
+GenericName[bs]=Stono izdavaštvo (DTP)
+GenericName[ca]=Publicació d'escriptori
+GenericName[cs]=Publikační systém (DTP)
+GenericName[cy]=Cyhoeddi Penbwrdd
+GenericName[da]=Dtp
+GenericName[eo]=DTP-programo
+GenericName[es]=Publicación de escritorio
+GenericName[et]=Küljendusrakendus
+GenericName[fa]=نشر میزکار
+GenericName[fi]=Julkaisuohjelma
+GenericName[fr]=Publication assistée par ordinateur (PAO)
+GenericName[he]=הוצאה לאור שולחנית
+GenericName[hr]=Stolno izdavaštvo
+GenericName[hu]=Kiadványszerkesztés
+GenericName[it]=Pubblicazioni
+GenericName[ja]=デスクトップパブリッシング
+GenericName[lo]=ເດດທອບພັລບບີດຊິງ
+GenericName[lt]=Darbastalio leidykla
+GenericName[nb]=Datatrykkeprogram
+GenericName[nn]=Datatrykk
+GenericName[nso]=Kwalakwatso ya Desktop
+GenericName[pl]=Program do składu tekstu
+GenericName[pt]=Edição Electrónica
+GenericName[pt_BR]=Editoração eletrônica
+GenericName[ru]=Настольная издательская система
+GenericName[sl]=Namizno založništvo
+GenericName[sr]=Стоно издаваштво
+GenericName[ss]=Kushicelela ku desktop
+GenericName[sv]=Desktop Publishing
+GenericName[th]=เดสก์ทอปพับลิชชิง
+GenericName[tr]=Masaüstü Yayıncılık
+GenericName[tt]=Өстәл нәшрияты
+GenericName[uk]=Видавнича система
+GenericName[uz]=Кичик нашриёт
+GenericName[ven]=U andadza Desikithopo
+GenericName[xh]=Upapasho lwe Desktop
+GenericName[zh_CN]=桌面出版
+GenericName[zh_TW]=桌面出版
+GenericName[zu]=Ukushicilelwa kwe-Desktop
+TryExec=scribus@TAG_VERSION@
+Exec=scribus@TAG_VERSION@ %f
+Icon=scribus@TAG_VERSION@
+Terminal=false
+MimeType=application/vnd.scribus;
+Categories=Qt;Graphics;Publishing;
+StartupWMClass=scribus@TAG_VERSION@
+DocPath=scribus@TAG_VERSION@
+StartupNotify=false
+X-AppInstall-Package=scribus@TAG_VERSION@
+X-AppInstall-Section=main
+X-KDE-SubstituteUID=false
+X-KDE-Username=
+[X-Property::X-KDE-NativeExtension]
+Type=QString
+Value=.sla
--- /dev/null
+++ b/scribus.appdata.xml.in
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright 2016 Peter Linnell  plinnell@scribus.net> -->
+
+<component type="desktop">
+  <id>scribus@TAG_VERSION@.desktop</id>
+  <metadata_license>CC0-1.0</metadata_license>
+  <project_license>GPL-2.0+</project_license>
+  <description>
+    <p>
+      Scribus is a desktop publishing application that allows you to create posters,
+      magazines and books ready to send off to a printing house.
+      It supports professional publishing features, such color separations, CMYK and
+      spot colors, ICC color management, and versatile PDF creation.
+    </p>
+    <!-- FIXME: Probably needs another paragraph or two -->
+  </description>
+  <url type="homepage">http://scribus.net/</url>
+  <screenshots>
+    <screenshot type="default">
+      <image>http://upload.wikimedia.org/wikipedia/commons/f/f4/Scribus-1.3-Linux.png</image>
+    </screenshot>
+  </screenshots>
+  <update_contact>admin@scribus.net</update_contact>
+</component>
--- a/scribus.appdata.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright 2016 Peter Linnell  plinnell@scribus.net> -->
-
-<component type="desktop">
-  <id>scribus.desktop</id>
-  <metadata_license>CC0-1.0</metadata_license>
-  <project_license>GPL-2.0+</project_license>
-  <description>
-    <p>
-      Scribus is a desktop publishing application that allows you to create posters,
-      magazines and books ready to send off to a printing house.
-      It supports professional publishing features, such color separations, CMYK and
-      spot colors, ICC color management, and versatile PDF creation.
-    </p>
-    <!-- FIXME: Probably needs another paragraph or two -->
-  </description>
-  <url type="homepage">http://scribus.net/</url>
-  <screenshots>
-    <screenshot type="default">
-      <image>http://upload.wikimedia.org/wikipedia/commons/f/f4/Scribus-1.3-Linux.png</image>
-    </screenshot>
-  </screenshots>
-  <update_contact>admin@scribus.net</update_contact>
-</component>
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1010,22 +1010,33 @@
 ENDIF (APPLE)
 
 #Install the .desktop file
+CONFIGURE_FILE(
+	${CMAKE_CURRENT_SOURCE_DIR}/scribus.desktop.in
+	${CMAKE_CURRENT_SOURCE_DIR}/scribus.desktop
+)
 INSTALL(FILES
 	scribus.desktop
+	RENAME scribus${TAG_VERSION}.desktop
 	DESTINATION ${DESKTOPDIR}
 )
 
 #Install our MIME data
 INSTALL(FILES
 	scribus.xml
+	RENAME scribus${TAG_VERSION}.xml
 	DESTINATION ${MIMEDIR}
 )
 
 
 #Install the appdata file
+CONFIGURE_FILE(
+	${CMAKE_CURRENT_SOURCE_DIR}/scribus.appdata.xml.in
+	${CMAKE_CURRENT_SOURCE_DIR}/scribus.appdata.xml
+)
 INSTALL(FILES
-scribus.appdata.xml
-DESTINATION ${APPDATADIR}
+	scribus.appdata.xml
+	RENAME scribus${TAG_VERSION}.appdata.xml
+	DESTINATION ${APPDATADIR}
 )
 
 
--- a/scribus.desktop
+++ /dev/null
@@ -1,109 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=Scribus
-Name[ar]=سكريبس
-Name[fa]=اسکریباس
-Name[lo]=ສະຄຣີບັດສ໌
-Name[ru]=Scribus
-Name[ta]=ஸ்கிரிபஸ்
-Comment=Page Layout and Publication
-Comment[ar]=سكريبس
-Comment[fa]=اسکریباس
-Comment[ta]=ஸ்கிரிபஸ்
-Comment[af]=Werkskerm Publisering
-Comment[bg]=Издателска програма
-Comment[bs]=Stono izdavaštvo (DTP)
-Comment[ca]=Publicació d'escriptori
-Comment[cs]=Publikační systém (DTP)
-Comment[cy]=Cyhoeddi Penbwrdd
-Comment[da]=Dtp
-Comment[eo]=DTP-programo
-Comment[es]=Publicación de escritorio
-Comment[et]=Küljendusrakendus
-Comment[fi]=Julkaisuohjelma
-Comment[fr]=Publication assistée par ordinateur (PAO)
-Comment[he]=הוצאה לאור שולחנית
-Comment[hr]=Stolno izdavaštvo
-Comment[hu]=Kiadványszerkesztés
-Comment[it]=Pubblicazioni
-Comment[ja]=デスクトップパブリッシング
-Comment[lo]=ເດດທອບພັລບບີດຊິງ
-Comment[lt]=Darbastalio leidykla
-Comment[nb]=Datatrykkeprogram
-Comment[nn]=Datatrykk
-Comment[nso]=Kwalakwatso ya Desktop
-Comment[pl]=Program do składu tekstu
-Comment[pt]=Publicação no Ecrã
-Comment[pt_BR]=Publicação do Ambiente de Trabalho
-Comment[ru]=Настольное издательство
-Comment[sl]=Namizno založništvo
-Comment[sr]=Стоно издаваштво
-Comment[ss]=Kushicelela ku desktop
-Comment[sv]=Desktop Publishing
-Comment[th]=เดสก์ทอปพับลิชชิง
-Comment[tr]=Masaüstü Yayıncılık
-Comment[uk]=Видавнича система
-Comment[uz]=Кичик нашриёт
-Comment[ven]=U andadza Desikithopo
-Comment[xh]=Upapasho lwe Desktop
-Comment[zh_CN]=桌面出版
-Comment[zh_TW]=桌面出版
-Comment[zu]=Ukushicilelwa kwe-Desktop
-GenericName=Page Layout (Development)
-GenericName[af]=Werkskerm Publisering
-GenericName[bg]=Издателска програма
-GenericName[bs]=Stono izdavaštvo (DTP)
-GenericName[ca]=Publicació d'escriptori
-GenericName[cs]=Publikační systém (DTP)
-GenericName[cy]=Cyhoeddi Penbwrdd
-GenericName[da]=Dtp
-GenericName[eo]=DTP-programo
-GenericName[es]=Publicación de escritorio
-GenericName[et]=Küljendusrakendus
-GenericName[fa]=نشر میزکار
-GenericName[fi]=Julkaisuohjelma
-GenericName[fr]=Publication assistée par ordinateur (PAO)
-GenericName[he]=הוצאה לאור שולחנית
-GenericName[hr]=Stolno izdavaštvo
-GenericName[hu]=Kiadványszerkesztés
-GenericName[it]=Pubblicazioni
-GenericName[ja]=デスクトップパブリッシング
-GenericName[lo]=ເດດທອບພັລບບີດຊິງ
-GenericName[lt]=Darbastalio leidykla
-GenericName[nb]=Datatrykkeprogram
-GenericName[nn]=Datatrykk
-GenericName[nso]=Kwalakwatso ya Desktop
-GenericName[pl]=Program do składu tekstu
-GenericName[pt]=Edição Electrónica
-GenericName[pt_BR]=Editoração eletrônica
-GenericName[ru]=Настольная издательская система
-GenericName[sl]=Namizno založništvo
-GenericName[sr]=Стоно издаваштво
-GenericName[ss]=Kushicelela ku desktop
-GenericName[sv]=Desktop Publishing
-GenericName[th]=เดสก์ทอปพับลิชชิง
-GenericName[tr]=Masaüstü Yayıncılık
-GenericName[tt]=Өстәл нәшрияты
-GenericName[uk]=Видавнича система
-GenericName[uz]=Кичик нашриёт
-GenericName[ven]=U andadza Desikithopo
-GenericName[xh]=Upapasho lwe Desktop
-GenericName[zh_CN]=桌面出版
-GenericName[zh_TW]=桌面出版
-GenericName[zu]=Ukushicilelwa kwe-Desktop
-TryExec=scribus
-Exec=scribus %f
-Icon=scribus
-Terminal=false
-MimeType=application/vnd.scribus;
-Categories=Qt;Graphics;Publishing;
-StartupWMClass=scribus
-DocPath=scribus
-StartupNotify=false
-X-AppInstall-Package=scribus
-X-AppInstall-Section=main
-X-KDE-SubstituteUID=false
-X-KDE-Username=
-[X-Property::X-KDE-NativeExtension]
-Type=QString
-Value=.sla
