I've updated the spec according to some of your comments.
The error I have is:
make install-data-hook
make[4]: Entering directory `/home/user/rpmbuild/BUILD/ZoneMinder-1.24.4/web'
( cd
/home/user/rpmbuild/BUILDROOT/ZoneMinder-1.24.4-1.mga1.x86_64/var/www/ZoneMinder;
chown apache:apache index.php )
chown: changing ownership of `index.php': Operation not permitted
Should I be root to run rpmbuild??
Thanks for your help
Vincent
On Fri, Jul 1, 2011 at 8:25 AM, Michael Scherer <[email protected]> wrote:
> Le jeudi 30 juin 2011 à 16:32 -0400, Vincent a écrit :
>> Hi All,
>>
>> I would like to participate to your project and to help you by packaging
>> rpms.
>>
>> As I don't know what needs to be packed, I've tried to make rpm for
>> ZoneMinder 1.24.4. But it fails to install into BUILDROOT environment. I
>> must have done something wrong while setting installation destinations.
>
> Can you give the exact error message ?
> You may need to create the directory by hand, if the makefile don't.
>
>> Attached is the spec file, and the patch to make it compiled.
>
> First, the description is too long and too big.
>
> The patch is not commented and do not explicitly what it does. And
> should also be sent upstream, so we will not have to apply it in the
> future.
>
>
> License: GPLV2 or later
> this is not the notation we usually use, this should be GPLv2+ ( see
> rpmlint to check that, and the wiki for licenses policy )
>
>
> BuildRequires: %{_lib}ffmpeg-devel
>
> this is incorrect, the BuildRequires will depend on the architecture
> where the src was rebuild. The BuildRequires must not change. Usually,
> there is a provides added for that ( but we are moving to having
> libffmpeg-devel on both arch ).
>
>
> --enable-mmap=yes \
> --disable-debug \
> --enable-mmap=no \
>
> Why disable and then enable mmap ?
>
>
>
> %post
>
> %postun
> [ $1 = 0 ] || exit 0
>
> Why ?
>
>
>
> %files
> %defattr(-,root,root)
> %_bindir/zma
>
> There is no documentation, and the file in /var do not seems to be
> present.
>
>
> --
> Michael Scherer
>
>
%define name ZoneMinder
%define version 1.24.4
%define release %mkrel 1
Summary: ZoneMinder, the all-in one Linux GPL'd security camera solution.
Name: %{name}
Version: %{version}
Release: %{release}
URL: http://www.zoneminder.com/
Source0: http://www2.zoneminder.com/downloads/%{name}-%{version}.tar.gz
Patch0: ZoneMinder-1.24.4-src.patch
License: GPLv2+
Group: System Environment/Daemons
# Need for configuration
BuildRequires: automake
BuildRequires: ffmpeg
BuildRequires: gnutls-devel
BuildRequires: %{_lib}ffmpeg-devel
BuildRequires: %{_lib}gnutls-devel
BuildRequires: %{_lib}jpeg-devel
BuildRequires: %{_lib}mysql-devel
BuildRequires: %{_lib}pcre-devel
BuildRequires: perl(Archive::Tar)
BuildRequires: perl(Archive::Zip)
BuildRequires: perl(Date::Manip)
BuildRequires: perl(DBD::mysql)
BuildRequires: perl(Device::SerialPort)
BuildRequires: perl(MIME::Lite)
# if apache is not here, make install is failing:
BuildRequires: apache
# need for post
Requires(post): /sbin/chkconfig
# need to run:
Requires: php-mysql
%description
ZoneMinder, security camera monitoring solution.
%prep
%setup -q
%patch0 -p0
%build
# remove ffmpeg compilation issue, see :
# http://www.zoneminder.com/wiki/index.php/FAQ#When_running_configure_I_am_getting_a_lot_of_messages_about_not_being_able_to_compile_the_ffmpeg_libraries
export CPPFLAGS=-D__STDC_CONSTANT_MACROS
OPTS=""
%ifnarch %{ix86} x86_64
OPTS+=" --disable-crashtrace"
%endif
%configure2_5x --with-webdir=/var/www/%{name} \
--with-cgidir=/var/cgi-bin/%{name} \
--with-libarch=%{_lib} \
--with-mysql=%{_prefix}/ \
--enable-mmap=no \
--disable-debug \
$OPTS
%make
%install
install -d %{buildroot}%{_localstatedir}/run
%makeinstall DESTDIR=%{buildroot}
rm -fr %{buildroot}
%clean
rm -rf %{buildroot}
%post
# Add zoneminder to to rc.d
/sbin/chkconfig --add zoneminder
%postun
#[ $1 = 0 ] || exit 0
%files
%defattr(-,root,root)
%doc AUTHORS COPYING README
%_bindir/zma
%_bindir/zmc
%_bindir/zmf
%_bindir/zmfix
%_bindir/zms
%_bindir/zmstreamer
%_bindir/zmu
%changelog
* Wed Jun 29 2011 Vincent Hervieux <[email protected]> 1.24.4-1.mga1
+ Revision: 520056
- building ZoneMinder for Mageia