gparted/Makefile.am

92 lines
2.9 KiB
Makefile
Raw Normal View History

ACLOCAL_AMFLAGS = -I m4
SUBDIRS = data doc include lib po src tests
# Only build GParted help documentation when enabled. (Can be disabled
# with './configure --disable-doc').
if BUILD_HELP_DOC
SUBDIRS += help
endif
2004-09-20 15:38:21 -06:00
DESKTOP_IN_IN_FILES = gparted.desktop.in.in
2004-09-20 15:38:21 -06:00
DESKTOP_IN_FILES = gparted.desktop.in
DESKTOP_FILES =$(DESKTOP_IN_FILES:.desktop.in=.desktop)
desktopdir = $(datadir)/applications
desktop_DATA = $(DESKTOP_FILES)
Migrate build from intltool to gettext translation (!107) [0] GNOME Goal: Gettext Migration https://wiki.gnome.org/Initiatives/GnomeGoals/GettextMigration This goal from 2016 is to migrate away from using intltool to help translate especially GNOME application related files, and instead use gettext directly now that gettext can handle a lot more file formats [1][2][3]. The GNOME Goal: Gettext Migration [0] says: "With gettext 0.19.8, there is really no need anymore to use intltool or GLib's dated gettext glue (AM_GLIB_GNU_GETTEXT and glib-gettextize)." This version or later of gettext is available in the oldest supported distributions except for SLES 12: Distribution EOL gettext -V Debian 10 2022-Aug 0.19.8.1 RHEL / CentOS 7 2024-Jun 0.19.8.1 Ubuntu 18.04 LTS 2023-Apr 0.19.8.1 SLES 12 SP5 2024-Oct 0.19.2 [4][5] As SLES 12 SP5 doesn't contain GParted and SLES 15 contains GParted 0.31.0 [6] loosing the ability to compile future GParted 1.5 release on SLES 12 SP5 is acceptable. Additionally the use of intltool and the associated GLib provided macro AM_GLIB_GNU_GETTEXT was the source of the remaining warnings from autoconf 2.71 seen in Fedora 36 and Ubuntu 22.04 LTS about the use of obsolete macros: $ ./autogen.sh ... autoreconf: running: /usr/bin/autoconf --force configure.ac:59: warning: The macro `GLIB_GNU_GETTEXT' is obsolete. configure.ac:59: You should run autoupdate. aclocal.m4:426: GLIB_GNU_GETTEXT is expanded from... >> aclocal.m4:526: AM_GLIB_GNU_GETTEXT is expanded from... >> configure.ac:59: the top level configure.ac:59: warning: The macro `AC_TRY_LINK' is obsolete. configure.ac:59: You should run autoupdate. ./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from... lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... ./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... aclocal.m4:111: GLIB_LC_MESSAGES is expanded from... aclocal.m4:426: GLIB_GNU_GETTEXT is expanded from... >> aclocal.m4:526: AM_GLIB_GNU_GETTEXT is expanded from... >> configure.ac:59: the top level configure.ac:59: warning: The macro `AC_TRY_LINK' is obsolete. configure.ac:59: You should run autoupdate. ... Note that use of AM_GLIB_GNU_GETTEXT was deprecated in GLib 2.47.5 released 2016-01-18 [7]. Newer versions of GLib are included in the oldest supported distributions: Distro Package containing Version glib-gettext.m4 Debian 10 libglib2.0-dev-bin 2.58.3 RHEL / CentOS 7 glib2-devel 2.56.1 Ubuntu 18.04 LTS libglib2.0-dev-bin 2.56.4 SLES 12 SP5 glib2-devel 2.48.2 Therefore perform the migration described in the GNOME wiki documents [0][1]. This involves: 1. Replacing the macros used in configure.ac; 2. Copying Makevars.template to po/Makevars and setting PO_DEPENDS_ON_POT and DIST_DEPENDS_ON_UPDATE_PO to "no"; 3. Replace @INTLTOOL_*@ macros in Makefile.am with rules to use gettext to directly translate the relevent GNOME application files; 4. Removing (_) underscore marking translation prefixes from XML tags in GNOME application files as gettext understands which tags of which files need translating. For reference are these commits in projects GNOME-System-Monitor [8], Reversi [9] and Evince [10] making the same transition. At this point "./autogen.sh && make" succeeds, at least on Ubuntu which provides the instructions gettext needs to correctly translate .policy files by default. These: /usr/share/gettext/its/polkit.its /usr/share/gettext/its/polkit.loc are included in the base policykit-1 package. [1] Migrating from Intltool to Gettext https://wiki.gnome.org/MigratingFromIntltoolToGettext [2] Using Modern Gettext https://blogs.gnome.org/mclasen/2016/07/21/using-modern-gettext/ [3] On the killing of intltool https://blogs.gnome.org/mcatanzaro/2016/07/27/on-the-killing-of-intltool/ [4] SUSE package search, SLES 12 SP5, gettext https://scc.suse.com/packages?name=SUSE%20Linux%20Enterprise%20Server&version=12.5&arch=x86_64&query=gettext&module= [5] SUSE Long Term Service Pack Support https://links.imagerelay.com/cdn/3404/ql/f3a083e9bcd34c76addd096d7f60ec00/long_term_service_pack_support_flyer.pdf [6] SUSE package search, SLES 15, gparted https://scc.suse.com/packages?name=SUSE%20Linux%20Enterprise%20Server&version=15&arch=x86_64&query=gparted&module= [7] Deprecate GLIB_GNU_GETTEXT macro, use upstream gettext instead https://gitlab.gnome.org/GNOME/glib/-/commit/6b577196eed0754d2805fd48caa64f58f9bb8ee4 [8] [GNOME-System-Monitor] Migrate from intltool https://gitlab.gnome.org/GNOME/gnome-system-monitor/-/commit/9185b9c713980391a6f1a2377eb5ea249a0df182 [9] [Reversi] Gettext migration (bgo#793040) https://gitlab.gnome.org/GNOME/iagno/-/commit/d22f560ac80d0ded2cb3a38cb10a65e17ead3850 [10] [Evince] build: Migrate from Intltool to Gettext https://gitlab.gnome.org/GNOME/evince/-/commit/4fd682132430feb8c012e4b0aa0c2c5da5ffe5ac Closes !107 - Migrate from intltool to gettext translation
2022-08-26 05:05:18 -06:00
$(DESKTOP_FILES): $(DESKTOP_IN_FILES)
$(AM_V_GEN)$(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@
APPDATA_IN_FILES = gparted.appdata.xml.in
APPDATA_FILES =$(APPDATA_IN_FILES:.xml.in=.xml)
appdatadir = $(datadir)/appdata
appdata_DATA = $(APPDATA_FILES)
Migrate build from intltool to gettext translation (!107) [0] GNOME Goal: Gettext Migration https://wiki.gnome.org/Initiatives/GnomeGoals/GettextMigration This goal from 2016 is to migrate away from using intltool to help translate especially GNOME application related files, and instead use gettext directly now that gettext can handle a lot more file formats [1][2][3]. The GNOME Goal: Gettext Migration [0] says: "With gettext 0.19.8, there is really no need anymore to use intltool or GLib's dated gettext glue (AM_GLIB_GNU_GETTEXT and glib-gettextize)." This version or later of gettext is available in the oldest supported distributions except for SLES 12: Distribution EOL gettext -V Debian 10 2022-Aug 0.19.8.1 RHEL / CentOS 7 2024-Jun 0.19.8.1 Ubuntu 18.04 LTS 2023-Apr 0.19.8.1 SLES 12 SP5 2024-Oct 0.19.2 [4][5] As SLES 12 SP5 doesn't contain GParted and SLES 15 contains GParted 0.31.0 [6] loosing the ability to compile future GParted 1.5 release on SLES 12 SP5 is acceptable. Additionally the use of intltool and the associated GLib provided macro AM_GLIB_GNU_GETTEXT was the source of the remaining warnings from autoconf 2.71 seen in Fedora 36 and Ubuntu 22.04 LTS about the use of obsolete macros: $ ./autogen.sh ... autoreconf: running: /usr/bin/autoconf --force configure.ac:59: warning: The macro `GLIB_GNU_GETTEXT' is obsolete. configure.ac:59: You should run autoupdate. aclocal.m4:426: GLIB_GNU_GETTEXT is expanded from... >> aclocal.m4:526: AM_GLIB_GNU_GETTEXT is expanded from... >> configure.ac:59: the top level configure.ac:59: warning: The macro `AC_TRY_LINK' is obsolete. configure.ac:59: You should run autoupdate. ./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from... lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... ./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... aclocal.m4:111: GLIB_LC_MESSAGES is expanded from... aclocal.m4:426: GLIB_GNU_GETTEXT is expanded from... >> aclocal.m4:526: AM_GLIB_GNU_GETTEXT is expanded from... >> configure.ac:59: the top level configure.ac:59: warning: The macro `AC_TRY_LINK' is obsolete. configure.ac:59: You should run autoupdate. ... Note that use of AM_GLIB_GNU_GETTEXT was deprecated in GLib 2.47.5 released 2016-01-18 [7]. Newer versions of GLib are included in the oldest supported distributions: Distro Package containing Version glib-gettext.m4 Debian 10 libglib2.0-dev-bin 2.58.3 RHEL / CentOS 7 glib2-devel 2.56.1 Ubuntu 18.04 LTS libglib2.0-dev-bin 2.56.4 SLES 12 SP5 glib2-devel 2.48.2 Therefore perform the migration described in the GNOME wiki documents [0][1]. This involves: 1. Replacing the macros used in configure.ac; 2. Copying Makevars.template to po/Makevars and setting PO_DEPENDS_ON_POT and DIST_DEPENDS_ON_UPDATE_PO to "no"; 3. Replace @INTLTOOL_*@ macros in Makefile.am with rules to use gettext to directly translate the relevent GNOME application files; 4. Removing (_) underscore marking translation prefixes from XML tags in GNOME application files as gettext understands which tags of which files need translating. For reference are these commits in projects GNOME-System-Monitor [8], Reversi [9] and Evince [10] making the same transition. At this point "./autogen.sh && make" succeeds, at least on Ubuntu which provides the instructions gettext needs to correctly translate .policy files by default. These: /usr/share/gettext/its/polkit.its /usr/share/gettext/its/polkit.loc are included in the base policykit-1 package. [1] Migrating from Intltool to Gettext https://wiki.gnome.org/MigratingFromIntltoolToGettext [2] Using Modern Gettext https://blogs.gnome.org/mclasen/2016/07/21/using-modern-gettext/ [3] On the killing of intltool https://blogs.gnome.org/mcatanzaro/2016/07/27/on-the-killing-of-intltool/ [4] SUSE package search, SLES 12 SP5, gettext https://scc.suse.com/packages?name=SUSE%20Linux%20Enterprise%20Server&version=12.5&arch=x86_64&query=gettext&module= [5] SUSE Long Term Service Pack Support https://links.imagerelay.com/cdn/3404/ql/f3a083e9bcd34c76addd096d7f60ec00/long_term_service_pack_support_flyer.pdf [6] SUSE package search, SLES 15, gparted https://scc.suse.com/packages?name=SUSE%20Linux%20Enterprise%20Server&version=15&arch=x86_64&query=gparted&module= [7] Deprecate GLIB_GNU_GETTEXT macro, use upstream gettext instead https://gitlab.gnome.org/GNOME/glib/-/commit/6b577196eed0754d2805fd48caa64f58f9bb8ee4 [8] [GNOME-System-Monitor] Migrate from intltool https://gitlab.gnome.org/GNOME/gnome-system-monitor/-/commit/9185b9c713980391a6f1a2377eb5ea249a0df182 [9] [Reversi] Gettext migration (bgo#793040) https://gitlab.gnome.org/GNOME/iagno/-/commit/d22f560ac80d0ded2cb3a38cb10a65e17ead3850 [10] [Evince] build: Migrate from Intltool to Gettext https://gitlab.gnome.org/GNOME/evince/-/commit/4fd682132430feb8c012e4b0aa0c2c5da5ffe5ac Closes !107 - Migrate from intltool to gettext translation
2022-08-26 05:05:18 -06:00
$(APPDATA_FILES): $(APPDATA_IN_FILES)
$(AM_V_GEN)$(MSGFMT) --xml --template $< -d $(top_srcdir)/po -o $@
Add required polkit action file (#776437) An action file is always needed with polkit to describe the privileged actions that are available to the subject (client program). For GParted the only available action is to run the gparted shell script as root. Note that the polkit action file will be installed into location $(prefix)/share/polkit-1/actions. This is required by the GNU Coding Standards [1] and to prevent 'make distcheck' from failing [2]. However polkit only uses /usr/share/polkit-1/actions for it's action files [3]. This dilemma was discussed in this Bugzilla bug 776437 and on the general Automake discussion email list [4]. The solution is to simply document in the README file that a manual additional installation step may be required. The action file is marked as translatable with the underscore (_) of the _description and _message tags identifying the string to be translated. Use of INTLTOOL_POLICY_RULE in Makefile.am to merge translations into the polkit action file necessitates increasing the minimum version of intltool to 0.36.0 where it was first introduced in intltool.m4. This will prevent GParted building on RedHat/CentOS 5 which only has intltool 0.35.0. But that doesn't matter because RedHat/CentOS 5 reached end of life on 31st March 2017. [1] GNU Coding Standards, 7.2.5 Variables for Installation Directories https://www.gnu.org/prep/standards/standards.html#Directory-Variables [2] Automake Manual, 27.10 Installing to Hard-Coded Locations https://www.gnu.org/software/automake/manual/automake.html#Hard_002dCoded-Install-Paths "My package needs to populate the installation directory of another package at install-time. I can easily compute that installation directory in configure, but if I install files therein, 'make distcheck' fails. How else should I do?" [3] polkit(8), Declaring Actions https://www.freedesktop.org/software/polkit/docs/latest/polkit.8.html#polkit-declaring-actions "A mechanism need to declare a set of actions in order to use polkit. Actions correspond to operations that clients can request the mechanism to carry out and are defined in XML files that the mechanism installs into the /usr/share/polkit-1/actions directory." [4] Not installing to hard-coded locations vs polkit's fixed location http://lists.gnu.org/archive/html/automake/2017-08/msg00015.html Bug 776437 - GParted fails to run as root under Wayland
2017-06-24 03:39:37 -06:00
polkit_action_in_in_FILES = org.gnome.gparted.policy.in.in
polkit_action_in_FILES = org.gnome.gparted.policy.in
polkit_action_FILES = $(polkit_action_in_FILES:.policy.in=.policy)
Migrate build from intltool to gettext translation (!107) [0] GNOME Goal: Gettext Migration https://wiki.gnome.org/Initiatives/GnomeGoals/GettextMigration This goal from 2016 is to migrate away from using intltool to help translate especially GNOME application related files, and instead use gettext directly now that gettext can handle a lot more file formats [1][2][3]. The GNOME Goal: Gettext Migration [0] says: "With gettext 0.19.8, there is really no need anymore to use intltool or GLib's dated gettext glue (AM_GLIB_GNU_GETTEXT and glib-gettextize)." This version or later of gettext is available in the oldest supported distributions except for SLES 12: Distribution EOL gettext -V Debian 10 2022-Aug 0.19.8.1 RHEL / CentOS 7 2024-Jun 0.19.8.1 Ubuntu 18.04 LTS 2023-Apr 0.19.8.1 SLES 12 SP5 2024-Oct 0.19.2 [4][5] As SLES 12 SP5 doesn't contain GParted and SLES 15 contains GParted 0.31.0 [6] loosing the ability to compile future GParted 1.5 release on SLES 12 SP5 is acceptable. Additionally the use of intltool and the associated GLib provided macro AM_GLIB_GNU_GETTEXT was the source of the remaining warnings from autoconf 2.71 seen in Fedora 36 and Ubuntu 22.04 LTS about the use of obsolete macros: $ ./autogen.sh ... autoreconf: running: /usr/bin/autoconf --force configure.ac:59: warning: The macro `GLIB_GNU_GETTEXT' is obsolete. configure.ac:59: You should run autoupdate. aclocal.m4:426: GLIB_GNU_GETTEXT is expanded from... >> aclocal.m4:526: AM_GLIB_GNU_GETTEXT is expanded from... >> configure.ac:59: the top level configure.ac:59: warning: The macro `AC_TRY_LINK' is obsolete. configure.ac:59: You should run autoupdate. ./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from... lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... ./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... aclocal.m4:111: GLIB_LC_MESSAGES is expanded from... aclocal.m4:426: GLIB_GNU_GETTEXT is expanded from... >> aclocal.m4:526: AM_GLIB_GNU_GETTEXT is expanded from... >> configure.ac:59: the top level configure.ac:59: warning: The macro `AC_TRY_LINK' is obsolete. configure.ac:59: You should run autoupdate. ... Note that use of AM_GLIB_GNU_GETTEXT was deprecated in GLib 2.47.5 released 2016-01-18 [7]. Newer versions of GLib are included in the oldest supported distributions: Distro Package containing Version glib-gettext.m4 Debian 10 libglib2.0-dev-bin 2.58.3 RHEL / CentOS 7 glib2-devel 2.56.1 Ubuntu 18.04 LTS libglib2.0-dev-bin 2.56.4 SLES 12 SP5 glib2-devel 2.48.2 Therefore perform the migration described in the GNOME wiki documents [0][1]. This involves: 1. Replacing the macros used in configure.ac; 2. Copying Makevars.template to po/Makevars and setting PO_DEPENDS_ON_POT and DIST_DEPENDS_ON_UPDATE_PO to "no"; 3. Replace @INTLTOOL_*@ macros in Makefile.am with rules to use gettext to directly translate the relevent GNOME application files; 4. Removing (_) underscore marking translation prefixes from XML tags in GNOME application files as gettext understands which tags of which files need translating. For reference are these commits in projects GNOME-System-Monitor [8], Reversi [9] and Evince [10] making the same transition. At this point "./autogen.sh && make" succeeds, at least on Ubuntu which provides the instructions gettext needs to correctly translate .policy files by default. These: /usr/share/gettext/its/polkit.its /usr/share/gettext/its/polkit.loc are included in the base policykit-1 package. [1] Migrating from Intltool to Gettext https://wiki.gnome.org/MigratingFromIntltoolToGettext [2] Using Modern Gettext https://blogs.gnome.org/mclasen/2016/07/21/using-modern-gettext/ [3] On the killing of intltool https://blogs.gnome.org/mcatanzaro/2016/07/27/on-the-killing-of-intltool/ [4] SUSE package search, SLES 12 SP5, gettext https://scc.suse.com/packages?name=SUSE%20Linux%20Enterprise%20Server&version=12.5&arch=x86_64&query=gettext&module= [5] SUSE Long Term Service Pack Support https://links.imagerelay.com/cdn/3404/ql/f3a083e9bcd34c76addd096d7f60ec00/long_term_service_pack_support_flyer.pdf [6] SUSE package search, SLES 15, gparted https://scc.suse.com/packages?name=SUSE%20Linux%20Enterprise%20Server&version=15&arch=x86_64&query=gparted&module= [7] Deprecate GLIB_GNU_GETTEXT macro, use upstream gettext instead https://gitlab.gnome.org/GNOME/glib/-/commit/6b577196eed0754d2805fd48caa64f58f9bb8ee4 [8] [GNOME-System-Monitor] Migrate from intltool https://gitlab.gnome.org/GNOME/gnome-system-monitor/-/commit/9185b9c713980391a6f1a2377eb5ea249a0df182 [9] [Reversi] Gettext migration (bgo#793040) https://gitlab.gnome.org/GNOME/iagno/-/commit/d22f560ac80d0ded2cb3a38cb10a65e17ead3850 [10] [Evince] build: Migrate from Intltool to Gettext https://gitlab.gnome.org/GNOME/evince/-/commit/4fd682132430feb8c012e4b0aa0c2c5da5ffe5ac Closes !107 - Migrate from intltool to gettext translation
2022-08-26 05:05:18 -06:00
$(polkit_action_FILES): $(polkit_action_in_FILES)
$(AM_V_GEN)$(MSGFMT) --xml --template $< -d $(top_srcdir)/po -o $@
Add required polkit action file (#776437) An action file is always needed with polkit to describe the privileged actions that are available to the subject (client program). For GParted the only available action is to run the gparted shell script as root. Note that the polkit action file will be installed into location $(prefix)/share/polkit-1/actions. This is required by the GNU Coding Standards [1] and to prevent 'make distcheck' from failing [2]. However polkit only uses /usr/share/polkit-1/actions for it's action files [3]. This dilemma was discussed in this Bugzilla bug 776437 and on the general Automake discussion email list [4]. The solution is to simply document in the README file that a manual additional installation step may be required. The action file is marked as translatable with the underscore (_) of the _description and _message tags identifying the string to be translated. Use of INTLTOOL_POLICY_RULE in Makefile.am to merge translations into the polkit action file necessitates increasing the minimum version of intltool to 0.36.0 where it was first introduced in intltool.m4. This will prevent GParted building on RedHat/CentOS 5 which only has intltool 0.35.0. But that doesn't matter because RedHat/CentOS 5 reached end of life on 31st March 2017. [1] GNU Coding Standards, 7.2.5 Variables for Installation Directories https://www.gnu.org/prep/standards/standards.html#Directory-Variables [2] Automake Manual, 27.10 Installing to Hard-Coded Locations https://www.gnu.org/software/automake/manual/automake.html#Hard_002dCoded-Install-Paths "My package needs to populate the installation directory of another package at install-time. I can easily compute that installation directory in configure, but if I install files therein, 'make distcheck' fails. How else should I do?" [3] polkit(8), Declaring Actions https://www.freedesktop.org/software/polkit/docs/latest/polkit.8.html#polkit-declaring-actions "A mechanism need to declare a set of actions in order to use polkit. Actions correspond to operations that clients can request the mechanism to carry out and are defined in XML files that the mechanism installs into the /usr/share/polkit-1/actions directory." [4] Not installing to hard-coded locations vs polkit's fixed location http://lists.gnu.org/archive/html/automake/2017-08/msg00015.html Bug 776437 - GParted fails to run as root under Wayland
2017-06-24 03:39:37 -06:00
polkit_actiondir = $(datadir)/polkit-1/actions
if INSTALL_POLKIT_ACTIONS
polkit_action_DATA = $(polkit_action_FILES)
endif
Add required polkit action file (#776437) An action file is always needed with polkit to describe the privileged actions that are available to the subject (client program). For GParted the only available action is to run the gparted shell script as root. Note that the polkit action file will be installed into location $(prefix)/share/polkit-1/actions. This is required by the GNU Coding Standards [1] and to prevent 'make distcheck' from failing [2]. However polkit only uses /usr/share/polkit-1/actions for it's action files [3]. This dilemma was discussed in this Bugzilla bug 776437 and on the general Automake discussion email list [4]. The solution is to simply document in the README file that a manual additional installation step may be required. The action file is marked as translatable with the underscore (_) of the _description and _message tags identifying the string to be translated. Use of INTLTOOL_POLICY_RULE in Makefile.am to merge translations into the polkit action file necessitates increasing the minimum version of intltool to 0.36.0 where it was first introduced in intltool.m4. This will prevent GParted building on RedHat/CentOS 5 which only has intltool 0.35.0. But that doesn't matter because RedHat/CentOS 5 reached end of life on 31st March 2017. [1] GNU Coding Standards, 7.2.5 Variables for Installation Directories https://www.gnu.org/prep/standards/standards.html#Directory-Variables [2] Automake Manual, 27.10 Installing to Hard-Coded Locations https://www.gnu.org/software/automake/manual/automake.html#Hard_002dCoded-Install-Paths "My package needs to populate the installation directory of another package at install-time. I can easily compute that installation directory in configure, but if I install files therein, 'make distcheck' fails. How else should I do?" [3] polkit(8), Declaring Actions https://www.freedesktop.org/software/polkit/docs/latest/polkit.8.html#polkit-declaring-actions "A mechanism need to declare a set of actions in order to use polkit. Actions correspond to operations that clients can request the mechanism to carry out and are defined in XML files that the mechanism installs into the /usr/share/polkit-1/actions directory." [4] Not installing to hard-coded locations vs polkit's fixed location http://lists.gnu.org/archive/html/automake/2017-08/msg00015.html Bug 776437 - GParted fails to run as root under Wayland
2017-06-24 03:39:37 -06:00
bin_SCRIPTS = gparted
Add required polkit action file (#776437) An action file is always needed with polkit to describe the privileged actions that are available to the subject (client program). For GParted the only available action is to run the gparted shell script as root. Note that the polkit action file will be installed into location $(prefix)/share/polkit-1/actions. This is required by the GNU Coding Standards [1] and to prevent 'make distcheck' from failing [2]. However polkit only uses /usr/share/polkit-1/actions for it's action files [3]. This dilemma was discussed in this Bugzilla bug 776437 and on the general Automake discussion email list [4]. The solution is to simply document in the README file that a manual additional installation step may be required. The action file is marked as translatable with the underscore (_) of the _description and _message tags identifying the string to be translated. Use of INTLTOOL_POLICY_RULE in Makefile.am to merge translations into the polkit action file necessitates increasing the minimum version of intltool to 0.36.0 where it was first introduced in intltool.m4. This will prevent GParted building on RedHat/CentOS 5 which only has intltool 0.35.0. But that doesn't matter because RedHat/CentOS 5 reached end of life on 31st March 2017. [1] GNU Coding Standards, 7.2.5 Variables for Installation Directories https://www.gnu.org/prep/standards/standards.html#Directory-Variables [2] Automake Manual, 27.10 Installing to Hard-Coded Locations https://www.gnu.org/software/automake/manual/automake.html#Hard_002dCoded-Install-Paths "My package needs to populate the installation directory of another package at install-time. I can easily compute that installation directory in configure, but if I install files therein, 'make distcheck' fails. How else should I do?" [3] polkit(8), Declaring Actions https://www.freedesktop.org/software/polkit/docs/latest/polkit.8.html#polkit-declaring-actions "A mechanism need to declare a set of actions in order to use polkit. Actions correspond to operations that clients can request the mechanism to carry out and are defined in XML files that the mechanism installs into the /usr/share/polkit-1/actions directory." [4] Not installing to hard-coded locations vs polkit's fixed location http://lists.gnu.org/archive/html/automake/2017-08/msg00015.html Bug 776437 - GParted fails to run as root under Wayland
2017-06-24 03:39:37 -06:00
CLEANFILES = $(bin_SCRIPTS) $(DESKTOP_IN_FILES) $(polkit_action_in_FILES)
do_subst = sed -e 's,[@]libexecdir[@],$(libexecdir),g' \
-e 's,[@]bindir[@],$(bindir),g' \
-e 's,[@]gksuprog[@],$(GKSUPROG),g' \
-e 's,[@]enable_xhost_root[@],$(ENABLE_XHOST_ROOT),g'
gparted.desktop.in: gparted.desktop.in.in Makefile
$(do_subst) < $(srcdir)/gparted.desktop.in.in > gparted.desktop.in
gparted: gparted.in Makefile
$(do_subst) < $(srcdir)/gparted.in > gparted
chmod +x gparted
Add required polkit action file (#776437) An action file is always needed with polkit to describe the privileged actions that are available to the subject (client program). For GParted the only available action is to run the gparted shell script as root. Note that the polkit action file will be installed into location $(prefix)/share/polkit-1/actions. This is required by the GNU Coding Standards [1] and to prevent 'make distcheck' from failing [2]. However polkit only uses /usr/share/polkit-1/actions for it's action files [3]. This dilemma was discussed in this Bugzilla bug 776437 and on the general Automake discussion email list [4]. The solution is to simply document in the README file that a manual additional installation step may be required. The action file is marked as translatable with the underscore (_) of the _description and _message tags identifying the string to be translated. Use of INTLTOOL_POLICY_RULE in Makefile.am to merge translations into the polkit action file necessitates increasing the minimum version of intltool to 0.36.0 where it was first introduced in intltool.m4. This will prevent GParted building on RedHat/CentOS 5 which only has intltool 0.35.0. But that doesn't matter because RedHat/CentOS 5 reached end of life on 31st March 2017. [1] GNU Coding Standards, 7.2.5 Variables for Installation Directories https://www.gnu.org/prep/standards/standards.html#Directory-Variables [2] Automake Manual, 27.10 Installing to Hard-Coded Locations https://www.gnu.org/software/automake/manual/automake.html#Hard_002dCoded-Install-Paths "My package needs to populate the installation directory of another package at install-time. I can easily compute that installation directory in configure, but if I install files therein, 'make distcheck' fails. How else should I do?" [3] polkit(8), Declaring Actions https://www.freedesktop.org/software/polkit/docs/latest/polkit.8.html#polkit-declaring-actions "A mechanism need to declare a set of actions in order to use polkit. Actions correspond to operations that clients can request the mechanism to carry out and are defined in XML files that the mechanism installs into the /usr/share/polkit-1/actions directory." [4] Not installing to hard-coded locations vs polkit's fixed location http://lists.gnu.org/archive/html/automake/2017-08/msg00015.html Bug 776437 - GParted fails to run as root under Wayland
2017-06-24 03:39:37 -06:00
org.gnome.gparted.policy.in: org.gnome.gparted.policy.in.in Makefile
$(do_subst) < $(srcdir)/org.gnome.gparted.policy.in.in > org.gnome.gparted.policy.in
dist-hook:
@if test -d "$(srcdir)/.git"; \
then \
echo Creating ChangeLog && \
( cd "$(top_srcdir)" && \
echo '# Generated by Makefile. Do not edit.'; echo; \
$(top_srcdir)/missing --run \
git log GPARTED_0_4_4.. --date-order --date=short | \
sed -e '/^commit.*$$/d' | \
awk '/^Author/ {sub(/\\$$/,""); getline t; print $$0 t; next}; 1' | \
sed -e 's/^Author: //g' | \
sed -e 's/>Date: \([0-9]*-[0-9]*-[0-9]*\)/>\t\1/g' | \
sed -e 's/^\([^\t<]*[<][^\t>]*>\)\t\([^\t]*\)/\2 \1/g'; \
echo; \
) > ChangeLog.tmp \
&& cat $(top_srcdir)/ChangeLog >> ChangeLog.tmp \
&& mv -f ChangeLog.tmp $(top_distdir)/ChangeLog \
|| ( rm -f ChangeLog.tmp ; \
echo Failed to generate ChangeLog >&2 ); \
else \
echo A git clone is required to generate a ChangeLog >&2; \
fi
EXTRA_DIST = \
$(APPDATA_IN_FILES) \
$(APPDATA_FILES) \
$(DESKTOP_IN_IN_FILES) \
$(DESKTOP_FILES) \
Add required polkit action file (#776437) An action file is always needed with polkit to describe the privileged actions that are available to the subject (client program). For GParted the only available action is to run the gparted shell script as root. Note that the polkit action file will be installed into location $(prefix)/share/polkit-1/actions. This is required by the GNU Coding Standards [1] and to prevent 'make distcheck' from failing [2]. However polkit only uses /usr/share/polkit-1/actions for it's action files [3]. This dilemma was discussed in this Bugzilla bug 776437 and on the general Automake discussion email list [4]. The solution is to simply document in the README file that a manual additional installation step may be required. The action file is marked as translatable with the underscore (_) of the _description and _message tags identifying the string to be translated. Use of INTLTOOL_POLICY_RULE in Makefile.am to merge translations into the polkit action file necessitates increasing the minimum version of intltool to 0.36.0 where it was first introduced in intltool.m4. This will prevent GParted building on RedHat/CentOS 5 which only has intltool 0.35.0. But that doesn't matter because RedHat/CentOS 5 reached end of life on 31st March 2017. [1] GNU Coding Standards, 7.2.5 Variables for Installation Directories https://www.gnu.org/prep/standards/standards.html#Directory-Variables [2] Automake Manual, 27.10 Installing to Hard-Coded Locations https://www.gnu.org/software/automake/manual/automake.html#Hard_002dCoded-Install-Paths "My package needs to populate the installation directory of another package at install-time. I can easily compute that installation directory in configure, but if I install files therein, 'make distcheck' fails. How else should I do?" [3] polkit(8), Declaring Actions https://www.freedesktop.org/software/polkit/docs/latest/polkit.8.html#polkit-declaring-actions "A mechanism need to declare a set of actions in order to use polkit. Actions correspond to operations that clients can request the mechanism to carry out and are defined in XML files that the mechanism installs into the /usr/share/polkit-1/actions directory." [4] Not installing to hard-coded locations vs polkit's fixed location http://lists.gnu.org/archive/html/automake/2017-08/msg00015.html Bug 776437 - GParted fails to run as root under Wayland
2017-06-24 03:39:37 -06:00
$(polkit_action_in_in_FILES) \
gparted.in
DISTCLEANFILES = \
$(appdata_DATA) \
$(desktop_DATA) \
Migrate build from intltool to gettext translation (!107) [0] GNOME Goal: Gettext Migration https://wiki.gnome.org/Initiatives/GnomeGoals/GettextMigration This goal from 2016 is to migrate away from using intltool to help translate especially GNOME application related files, and instead use gettext directly now that gettext can handle a lot more file formats [1][2][3]. The GNOME Goal: Gettext Migration [0] says: "With gettext 0.19.8, there is really no need anymore to use intltool or GLib's dated gettext glue (AM_GLIB_GNU_GETTEXT and glib-gettextize)." This version or later of gettext is available in the oldest supported distributions except for SLES 12: Distribution EOL gettext -V Debian 10 2022-Aug 0.19.8.1 RHEL / CentOS 7 2024-Jun 0.19.8.1 Ubuntu 18.04 LTS 2023-Apr 0.19.8.1 SLES 12 SP5 2024-Oct 0.19.2 [4][5] As SLES 12 SP5 doesn't contain GParted and SLES 15 contains GParted 0.31.0 [6] loosing the ability to compile future GParted 1.5 release on SLES 12 SP5 is acceptable. Additionally the use of intltool and the associated GLib provided macro AM_GLIB_GNU_GETTEXT was the source of the remaining warnings from autoconf 2.71 seen in Fedora 36 and Ubuntu 22.04 LTS about the use of obsolete macros: $ ./autogen.sh ... autoreconf: running: /usr/bin/autoconf --force configure.ac:59: warning: The macro `GLIB_GNU_GETTEXT' is obsolete. configure.ac:59: You should run autoupdate. aclocal.m4:426: GLIB_GNU_GETTEXT is expanded from... >> aclocal.m4:526: AM_GLIB_GNU_GETTEXT is expanded from... >> configure.ac:59: the top level configure.ac:59: warning: The macro `AC_TRY_LINK' is obsolete. configure.ac:59: You should run autoupdate. ./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from... lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... ./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... aclocal.m4:111: GLIB_LC_MESSAGES is expanded from... aclocal.m4:426: GLIB_GNU_GETTEXT is expanded from... >> aclocal.m4:526: AM_GLIB_GNU_GETTEXT is expanded from... >> configure.ac:59: the top level configure.ac:59: warning: The macro `AC_TRY_LINK' is obsolete. configure.ac:59: You should run autoupdate. ... Note that use of AM_GLIB_GNU_GETTEXT was deprecated in GLib 2.47.5 released 2016-01-18 [7]. Newer versions of GLib are included in the oldest supported distributions: Distro Package containing Version glib-gettext.m4 Debian 10 libglib2.0-dev-bin 2.58.3 RHEL / CentOS 7 glib2-devel 2.56.1 Ubuntu 18.04 LTS libglib2.0-dev-bin 2.56.4 SLES 12 SP5 glib2-devel 2.48.2 Therefore perform the migration described in the GNOME wiki documents [0][1]. This involves: 1. Replacing the macros used in configure.ac; 2. Copying Makevars.template to po/Makevars and setting PO_DEPENDS_ON_POT and DIST_DEPENDS_ON_UPDATE_PO to "no"; 3. Replace @INTLTOOL_*@ macros in Makefile.am with rules to use gettext to directly translate the relevent GNOME application files; 4. Removing (_) underscore marking translation prefixes from XML tags in GNOME application files as gettext understands which tags of which files need translating. For reference are these commits in projects GNOME-System-Monitor [8], Reversi [9] and Evince [10] making the same transition. At this point "./autogen.sh && make" succeeds, at least on Ubuntu which provides the instructions gettext needs to correctly translate .policy files by default. These: /usr/share/gettext/its/polkit.its /usr/share/gettext/its/polkit.loc are included in the base policykit-1 package. [1] Migrating from Intltool to Gettext https://wiki.gnome.org/MigratingFromIntltoolToGettext [2] Using Modern Gettext https://blogs.gnome.org/mclasen/2016/07/21/using-modern-gettext/ [3] On the killing of intltool https://blogs.gnome.org/mcatanzaro/2016/07/27/on-the-killing-of-intltool/ [4] SUSE package search, SLES 12 SP5, gettext https://scc.suse.com/packages?name=SUSE%20Linux%20Enterprise%20Server&version=12.5&arch=x86_64&query=gettext&module= [5] SUSE Long Term Service Pack Support https://links.imagerelay.com/cdn/3404/ql/f3a083e9bcd34c76addd096d7f60ec00/long_term_service_pack_support_flyer.pdf [6] SUSE package search, SLES 15, gparted https://scc.suse.com/packages?name=SUSE%20Linux%20Enterprise%20Server&version=15&arch=x86_64&query=gparted&module= [7] Deprecate GLIB_GNU_GETTEXT macro, use upstream gettext instead https://gitlab.gnome.org/GNOME/glib/-/commit/6b577196eed0754d2805fd48caa64f58f9bb8ee4 [8] [GNOME-System-Monitor] Migrate from intltool https://gitlab.gnome.org/GNOME/gnome-system-monitor/-/commit/9185b9c713980391a6f1a2377eb5ea249a0df182 [9] [Reversi] Gettext migration (bgo#793040) https://gitlab.gnome.org/GNOME/iagno/-/commit/d22f560ac80d0ded2cb3a38cb10a65e17ead3850 [10] [Evince] build: Migrate from Intltool to Gettext https://gitlab.gnome.org/GNOME/evince/-/commit/4fd682132430feb8c012e4b0aa0c2c5da5ffe5ac Closes !107 - Migrate from intltool to gettext translation
2022-08-26 05:05:18 -06:00
$(polkit_action_DATA)