diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-12-19 11:23:42 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-12-20 21:35:29 +0100 |
commit | a67c318df8800ba98d7361308937ed276dc73982 (patch) | |
tree | 5fd45225350cf5974714ea0c6cba4c9aecdfcdfd | |
parent | d2aaf130991149055f2f9b606d0b52d673d75cfd (diff) | |
download | systemd-a67c318df8800ba98d7361308937ed276dc73982.tar.gz systemd-a67c318df8800ba98d7361308937ed276dc73982.tar.bz2 systemd-a67c318df8800ba98d7361308937ed276dc73982.zip |
meson: define PROJECT_VERSION as the "bare" project version
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.)
-rw-r--r-- | meson.build | 5 | ||||
-rw-r--r-- | src/core/systemd.pc.in | 4 | ||||
-rw-r--r-- | src/libsystemd/libsystemd.pc.in | 4 | ||||
-rw-r--r-- | src/libsystemd/sd-hwdb/hwdb-util.c | 2 | ||||
-rw-r--r-- | src/libudev/libudev.pc.in | 2 | ||||
-rw-r--r-- | src/test/test-path-util.c | 2 | ||||
-rw-r--r-- | src/udev/udev.pc.in | 2 |
7 files changed, 11 insertions, 10 deletions
diff --git a/meson.build b/meson.build index 88fe6a1615..7816ba9949 100644 --- a/meson.build +++ b/meson.build @@ -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') diff --git a/src/core/systemd.pc.in b/src/core/systemd.pc.in index 655773ea8a..0dae950473 100644 --- a/src/core/systemd.pc.in +++ b/src/core/systemd.pc.in @@ -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@ diff --git a/src/libsystemd/libsystemd.pc.in b/src/libsystemd/libsystemd.pc.in index c861905b67..a010dea2e9 100644 --- a/src/libsystemd/libsystemd.pc.in +++ b/src/libsystemd/libsystemd.pc.in @@ -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} diff --git a/src/libsystemd/sd-hwdb/hwdb-util.c b/src/libsystemd/sd-hwdb/hwdb-util.c index c5c329f2ac..f8529670b3 100644 --- a/src/libsystemd/sd-hwdb/hwdb-util.c +++ b/src/libsystemd/sd-hwdb/hwdb-util.c @@ -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)), diff --git a/src/libudev/libudev.pc.in b/src/libudev/libudev.pc.in index 69f5c6463e..40b340362e 100644 --- a/src/libudev/libudev.pc.in +++ b/src/libudev/libudev.pc.in @@ -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} diff --git a/src/test/test-path-util.c b/src/test/test-path-util.c index 8854a94f6c..c64ca7b016 100644 --- a/src/test/test-path-util.c +++ b/src/test/test-path-util.c @@ -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++) { diff --git a/src/udev/udev.pc.in b/src/udev/udev.pc.in index e384a6f7c9..5acbb2d01a 100644 --- a/src/udev/udev.pc.in +++ b/src/udev/udev.pc.in @@ -1,5 +1,5 @@ Name: udev Description: udev -Version: @PACKAGE_VERSION@ +Version: @PROJECT_VERSION@ udevdir=@udevlibexecdir@ |