]> git.ipfire.org Git - people/ms/ipfire-3.x.git/commitdiff
cmake: Add pakfire macro.
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 9 Oct 2012 12:26:00 +0000 (14:26 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 9 Oct 2012 12:26:00 +0000 (14:26 +0200)
This macro makes it more easy to build packages in
a consistent way with cmake.

cmake/cmake.macro [new file with mode: 0644]
cmake/cmake.nm

diff --git a/cmake/cmake.macro b/cmake/cmake.macro
new file mode 100644 (file)
index 0000000..222a950
--- /dev/null
@@ -0,0 +1,18 @@
+#
+# cmake macros
+#
+
+__cmake = /usr/bin/cmake
+if "${lib}" == "lib64"
+       __cmake_lib_suffix = -DLIB_SUFFIX=64
+end
+
+cmake = %{__cmake} \
+       -DCMAKE_VERBOSE_MAKEFILE=ON \
+       -DCMAKE_INSTALL_PREFIX:PATH=%{prefix} \
+       -DINCLUDE_INSTALL_DIR:PATH=%{includedir} \
+       -DLIB_INSTALL_DIR:PATH=%{libdir} \
+       -DSYSCONF_INSTALL_DIR:PATH=%{sysconfdir} \
+       -DSHARE_INSTALL_PREFIX:PATH=%{datadir} \
+       %{__cmake_lib_suffix} \
+       -DBUILD_SHARED_LIBS:BOOL=ON
index ddbe23aa04b3baa613cc9de8b2faeed2fbc5ad09..c037f8737b00c28df7fcb3ec08126d4cf52f5f85 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = cmake
 version    = 2.8.4
-release    = 1
+release    = 2
 
 groups     = Development/Tools
 url        = http://www.cmake.org
@@ -60,12 +60,16 @@ build
 
        install
                cd build && make install DESTDIR=%{BUILDROOT}
+
+               # Install pakfire macro.
+               mkdir -p %{BUILDROOT}/usr/lib/pakfire/macros
+               install -v -m 644 %{DIR_SOURCE}/cmake.macro \
+                       %{BUILDROOT}/usr/lib/pakfire/macros
        end
 end
 
 packages
        package %{name}
-       end
 
        package %{name}-debuginfo
                template DEBUGINFO