summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2016-04-11 18:34:27 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2016-04-11 18:34:27 +0200
commit66acb1b1055aceba187a387b50f78885c8d11208 (patch)
treef00a12a20d6da53151bfaeb5bfda409acc81f8cc
parent4968f66059e9ca6d8c48b55460a73bfbc72fd1aa (diff)
Enable Centos 5 build in Fedora Copr
-rw-r--r--Makefile.am1
-rw-r--r--configure.ac1
-rw-r--r--copr/testdisk.spec27
-rw-r--r--mkdir.m423
4 files changed, 50 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am
index 6d45f6b..c0f7e53 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,5 @@
SUBDIRS = icons man src
+docdir ?= $(datadir)/doc/$(PACKAGE)
EXTRA_DIST = AUTHORS COPYING ChangeLog INFO INSTALL NEWS README.md README_dev_photorec.txt THANKS compile.sh \
progsreiserfs-journal.patch progsreiserfs-file-read.patch \
diff --git a/configure.ac b/configure.ac
index 14e9a47..cb1f924 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,6 +5,7 @@ AC_PREREQ([2.59])
AC_INIT([testdisk],[7.1-WIP],[grenier@cgsecurity.org])
AC_LANG(C)
sinclude(acx_pthread.m4)
+sinclude(mkdir.m4)
TESTDISKDATE="April 2016"
AC_SUBST(TESTDISKDATE)
AC_DEFINE_UNQUOTED([TESTDISKDATE],"$TESTDISKDATE",[Date of release])
diff --git a/copr/testdisk.spec b/copr/testdisk.spec
index 0cac302..487401a 100644
--- a/copr/testdisk.spec
+++ b/copr/testdisk.spec
@@ -14,12 +14,14 @@ BuildRequires: desktop-file-utils
BuildRequires: e2fsprogs-devel
BuildRequires: libewf-devel
BuildRequires: libjpeg-devel
-BuildRequires: libuuid-devel
BuildRequires: ncurses-devel >= 5.2
BuildRequires: ntfs-3g-devel
+BuildRequires: zlib-devel
+%if "%{el5}" != "1"
+BuildRequires: libuuid-devel
BuildRequires: qt5-linguist
BuildRequires: qt5-qtbase-devel
-BuildRequires: zlib-devel
+%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
@@ -53,6 +55,7 @@ Linux Raid, Linux Swap, LVM, LVM2, NSS, ReiserFS, UFS, XFS.
PhotoRec is a signature based file recovery utility. It handles more than
440 file formats including JPG, MSOffice, OpenOffice documents.
+%if "%{el5}" != "1"
%package -n qphotorec
Summary: Signature based file carver. Recover lost files
Group: Applications/System
@@ -62,12 +65,18 @@ QPhotoRec is a Qt version of PhotoRec. It is a signature based file recovery
utility. It handles more than 440 file formats including JPG, MSOffice,
OpenOffice documents.
+%endif
+
%prep
%setup -q
%build
autoreconf -vif -I config -W all
+%if "%{el5}" == "1"
+%configure
+%else
%configure --docdir=%{_pkgdocdir}
+%endif
make %{?_smp_mflags}
%install
rm -rf %{buildroot}
@@ -76,6 +85,7 @@ make DESTDIR="%{buildroot}" install
%clean
rm -rf %{buildroot}
+%if "%{el5}" != "1"
%check
desktop-file-validate %{buildroot}/%{_datadir}/applications/qphotorec.desktop
@@ -91,11 +101,22 @@ fi
%posttrans -n qphotorec
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
+%endif
+
%files
%defattr(644,root,root,755)
+%if "%{el5}" == "1"
+%doc /usr/share/doc/testdisk/AUTHORS
+%doc /usr/share/doc/testdisk/ChangeLog
+%doc /usr/share/doc/testdisk/NEWS
+%doc /usr/share/doc/testdisk/README.md
+%doc /usr/share/doc/testdisk/THANKS
+%doc /usr/share/doc/testdisk/documentation.html
+%else
%license COPYING
%doc AUTHORS ChangeLog NEWS README.md THANKS
%doc documentation.html
+%endif
%attr(755,root,root) %{_bindir}/fidentify
%attr(755,root,root) %{_bindir}/photorec
%attr(755,root,root) %{_bindir}/testdisk
@@ -106,6 +127,7 @@ fi
%{_mandir}/zh_CN/man8/photorec.8*
%{_mandir}/zh_CN/man8/testdisk.8*
+%if "%{el5}" != "1"
%files -n qphotorec
%attr(755,root,root) %{_bindir}/qphotorec
%{_mandir}/man8/qphotorec.8*
@@ -113,6 +135,7 @@ fi
%{_datadir}/applications/qphotorec.desktop
%{_datadir}/icons/hicolor/48x48/apps/qphotorec.png
%{_datadir}/icons/hicolor/scalable/apps/qphotorec.svg
+%endif
%changelog
* Sun Jan 24 2016 Christophe Grenier <grenier@cgsecurity.org> 7.1-0
diff --git a/mkdir.m4 b/mkdir.m4
new file mode 100644
index 0000000..ac18d01
--- /dev/null
+++ b/mkdir.m4
@@ -0,0 +1,23 @@
+dnl Copyright (C) 2007-2015 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# AC_PROG_MKDIR_P
+# is a backport of autoconf-2.60's AC_PROG_MKDIR_P, with a fix
+# for interoperability with automake-1.9.6 from autoconf-2.62.
+# Remove this macro when we can assume autoconf >= 2.62 or
+# autoconf >= 2.60 && automake >= 1.10.
+# AC_AUTOCONF_VERSION was introduced in 2.62, so use that as the witness.
+m4_ifndef([AC_AUTOCONF_VERSION],[
+m4_ifdef([AC_PROG_MKDIR_P], [
+ dnl For automake-1.9.6 && autoconf < 2.62: Ensure MKDIR_P is AC_SUBSTed.
+ m4_define([AC_PROG_MKDIR_P],
+ m4_defn([AC_PROG_MKDIR_P])[
+ AC_SUBST([MKDIR_P])])], [
+ dnl For autoconf < 2.60: Backport of AC_PROG_MKDIR_P.
+ AC_DEFUN_ONCE([AC_PROG_MKDIR_P],
+ [AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
+ MKDIR_P='$(mkdir_p)'
+ AC_SUBST([MKDIR_P])])])
+])