]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: define PROJECT_VERSION as the "bare" project version
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 19 Dec 2018 10:23:42 +0000 (11:23 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 20 Dec 2018 20:35:29 +0000 (21:35 +0100)
Let's not use atoi() if we can simply provide the project version as a number.

In C code, this is the numerical project version. In substitutions in other
files, this is just the bare substitution.

The "PACKAGE_" prefix is from autotools, and is strange. We call systemd a
"project", and "package" is something that distros build. Let's rename.

PACKAGE_URL is renamed to PROJECT_URL for the same reasons and for consistency.

(This leave PACKAGE_VERSION as the stringified define for C code.)

meson.build
src/core/systemd.pc.in
src/libsystemd/libsystemd.pc.in
src/libsystemd/sd-hwdb/hwdb-util.c
src/libudev/libudev.pc.in
src/test/test-path-util.c
src/udev/udev.pc.in

index 88fe6a16156d571589b715a7b86fd055e2e8a696..7816ba99490722ce0fed258f1cc90ad6930ecb78 100644 (file)
@@ -20,11 +20,12 @@ libudev_version = '1.6.11'
 # names, sometimes. Not all variables are included in every
 # set. Ugh, ugh, ugh!
 conf = configuration_data()
+conf.set('PROJECT_VERSION',        meson.project_version())
 conf.set_quoted('PACKAGE_VERSION', meson.project_version())
 
 substs = configuration_data()
-substs.set('PACKAGE_URL',          'https://www.freedesktop.org/wiki/Software/systemd')
-substs.set('PACKAGE_VERSION',      meson.project_version())
+substs.set('PROJECT_URL',          'https://www.freedesktop.org/wiki/Software/systemd')
+substs.set('PROJECT_VERSION',      meson.project_version())
 
 want_ossfuzz = get_option('oss-fuzz')
 want_libfuzzer = get_option('llvm-fuzz')
index 655773ea8a97df2d4207e5510b8630fbffc02483..0dae95047337e3a371d233404708ffbe5eb3559f 100644 (file)
@@ -36,5 +36,5 @@ containeruidbasemax=@containeruidbasemax@
 
 Name: systemd
 Description: systemd System and Service Manager
-URL: @PACKAGE_URL@
-Version: @PACKAGE_VERSION@
+URL: @PROJECT_URL@
+Version: @PROJECT_VERSION@
index c861905b67b89dc43991e3f5eb11adc98293c558..a010dea2e92f7d7e7961ceb91eb9b1b0302ed37a 100644 (file)
@@ -14,7 +14,7 @@ includedir=@includedir@
 
 Name: systemd
 Description: systemd Library
-URL: @PACKAGE_URL@
-Version: @PACKAGE_VERSION@
+URL: @PROJECT_URL@
+Version: @PROJECT_VERSION@
 Libs: -L${libdir} -lsystemd
 Cflags: -I${includedir}
index c5c329f2ac6c7538172a7541059188cff40b70db..f8529670b35fa9c6c146cd0ddbfb46ba0781d9e2 100644 (file)
@@ -367,7 +367,7 @@ static int trie_store(struct trie *trie, const char *filename, bool compat) {
         int64_t size;
         struct trie_header_f h = {
                 .signature = HWDB_SIG,
-                .tool_version = htole64(atoi(PACKAGE_VERSION)),
+                .tool_version = htole64(PROJECT_VERSION),
                 .header_size = htole64(sizeof(struct trie_header_f)),
                 .node_size = htole64(sizeof(struct trie_node_f)),
                 .child_entry_size = htole64(sizeof(struct trie_child_entry_f)),
index 69f5c6463ea3547258f1564ea06fad836fb3ef46..40b340362e4bf52e4fd1a5da677223d9b2a38489 100644 (file)
@@ -14,6 +14,6 @@ includedir=@includedir@
 
 Name: libudev
 Description: Library to access udev device information
-Version: @PACKAGE_VERSION@
+Version: @PROJECT_VERSION@
 Libs: -L${libdir} -ludev
 Cflags: -I${includedir}
index 8854a94f6ccc730709ebc8e35fa2933de230750a..c64ca7b016d36e1b73b0a751f5e385cf0f7402cc 100644 (file)
@@ -531,7 +531,7 @@ static void test_hidden_or_backup_file(void) {
 
 static void test_systemd_installation_has_version(const char *path) {
         int r;
-        const unsigned versions[] = {0, 231, atoi(PACKAGE_VERSION), 999};
+        const unsigned versions[] = {0, 231, PROJECT_VERSION, 999};
         unsigned i;
 
         for (i = 0; i < ELEMENTSOF(versions); i++) {
index e384a6f7c9ca10e7168df9f9d1a4b1a0f751b6c7..5acbb2d01a95791740837eb20e0893fb6699a913 100644 (file)
@@ -1,5 +1,5 @@
 Name: udev
 Description: udev
-Version: @PACKAGE_VERSION@
+Version: @PROJECT_VERSION@
 
 udevdir=@udevlibexecdir@