diff options
-rw-r--r-- | CMakeLists.txt | 4 | ||||
-rwxr-xr-x | tools/create_fedora_source.sh | 14 | ||||
-rw-r--r-- | tools/hardinfo.spec | 60 |
3 files changed, 71 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index c0eaa76e..288bed49 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -121,7 +121,7 @@ if(DISTRO) set(CPACK_PACKAGE_VERSION "${HARDINFO2_VERSION}-${DISTRO_BUILD_VER}") set(PACKAGE_DISTRO "${HARDINFO2_VERSION}-${DISTRO}") if(${DISTRO_BUILD_VER} MATCHES "src") -# SET(CPACK_RPM_USER_BINARY_SPECFILE "hardinfo.spec") + SET(CPACK_RPM_USER_BINARY_SPECFILE "hardinfo.spec") set(CPACK_PACKAGE_VERSION "${HARDINFO2_VERSION}") set(PACKAGE_DISTRO "${HARDINFO2_VERSION}") endif() @@ -555,7 +555,7 @@ SET(CPACK_RPM_PACKAGE_RECOMMENDS "sysbench, udisks2, mesa-utils, lsscsi, lm-sens SET(CPACK_RPM_PACKAGE_LICENSE "GPL2+") SET(CPACK_RPM_PACKAGE_HOMEPAGE "https://github.com/hardinfo2/hardinfo2") SET(CPACK_RPM_PACKAGE_URL "https://www.hardinfo2.org") -SET(CPACK_RPM_SOURCE_PKG_BUILD_PARAMS "-DDISTRO=1") +#SET(CPACK_RPM_SOURCE_PKG_BUILD_PARAMS "-DDISTRO=1") if(HARDINFO2_LIBSOUP3) SET(PACKAGE_LS "libsoup (>=3.0)") else() diff --git a/tools/create_fedora_source.sh b/tools/create_fedora_source.sh index e6f851f5..2b68e698 100755 --- a/tools/create_fedora_source.sh +++ b/tools/create_fedora_source.sh @@ -2,26 +2,29 @@ VERSION=$(cat ../CMakeLists.txt |grep set\(HARDINFO2_VERSION|cut -d '"' -f 2) cd .. rm -rf build -yum -y remove hardinfo +sudo yum -y remove hardinfo rm -rf ~/rpmbuild mkdir build cd build cmake -DDISTRO=src .. +cp ../tools/hardinfo.spec . make package_source -cp _CPackage_Packages/Linux-Source/RPM/SPECS/hardinfo.spec . +#cp _CPack_Packages/Linux-Source/RPM/SPECS/hardinfo.spec . echo "Fedora Source Package Files ready in build:" ls -l hardinfo-$VERSION*.src.rpm ls -l hardinfo.spec +#exit sleep 3 #checking -fedpkg --release f39 lint +#fedpkg --release f39 lint #install src package -rpm --nomd5 -i ./hardinfo-$VERSION-1.src.rpm +sudo rpm --nomd5 -i ./hardinfo-$VERSION-1.src.rpm +#cp -r ../tools/hardinfo.spec ~/rpmbuild/SPECS/ #create package from srpm cd ~/rpmbuild/SPECS @@ -29,4 +32,5 @@ rpmbuild -ba hardinfo.spec echo "Fedora binary build from Source Package Files ready:" ls -l ~/rpmbuild/RPMS/* -yum -y install ~/rpmbuild/RPMS/hardinfo-$VERSION* +sudo yum -y install ~/rpmbuild/RPMS/hardinfo-$VERSION* +yum info hardinfo diff --git a/tools/hardinfo.spec b/tools/hardinfo.spec new file mode 100644 index 00000000..eadcd5f6 --- /dev/null +++ b/tools/hardinfo.spec @@ -0,0 +1,60 @@ +# Restore old style debuginfo creation for rpm >= 4.14. +%undefine _debugsource_packages +%undefine _debuginfo_subpackages + +# -*- rpm-spec -*- +BuildRoot: %_topdir/hardinfo-2.0.12 +Summary: hardinfo2 built using CMake +Name: hardinfo +Version: 2.0.12 +Release: 1 +License: GPL2+ +Group: unknown +Vendor: Humanity + +Source: hardinfo-2.0.12.tar.gz + + + + +%define debug_package %{nil} + +%define _rpmdir %_topdir/RPMS +%define _srcrpmdir %_topdir/SRPMS +%define _rpmfilename hardinfo-2.0.12.rpm +%define _unpackaged_files_terminate_build 0 + + + + + +%description +Hardinfo2 - System Information and Benchmark + +# This is a shortcutted spec file generated by CMake RPM generator +# we skip _install step because CPack does that for us. +# We do only save CPack installed tree in _prepr +# and then restore it in build. +%prep +%setup -c + + +%build +mkdir cpack_rpm_build_dir +cd cpack_rpm_build_dir +'/usr/bin/cmake' ../hardinfo-2.0.12 +make %{?_smp_mflags} + +#p build + +%install + +cd cpack_rpm_build_dir +cpack -G RPM +mv *.rpm %_rpmdir + +%clean + +%changelog +* Sun Jul 4 2010 Eric Noulard <eric.noulard@gmail.com> - 2.0.12-1 + Generated by CPack RPM (no Changelog file were provided) |