john_erlandsson
28th August 2010, 04:04 PM
Hi!
Im having some problems building a package as an RPM. This is the first time i atempt something like this.
The package comes with a .spec file, but it is configured for openSUSE.
I altered it to fit my fedora system, and after a lot of struggling got it to build. But it still exits with an error in the install stage.
cp: cannot stat `/usr/src/kernels/2.6.33.8-149.fc13.i686/modules.order': No such file or directory
make: *** [_modinst_] Error 1
make: Leaving directory `/usr/src/kernels/2.6.33.8-149.fc13.i686'
error: Bad exit status from /var/tmp/rpm-tmp.h62rIF (%install)
I cant find anything in the .spec file that points to the modules.order dir.
On my system the modules.order file is in: /usr/src/kernels/<kernel version>/scripts/ but it is empty.
Any ideas?
Is it a matter of specifying the location of modules.order or is there something wrong with my kernel sources?
This is the original .spec file
# REMOVED THE COMMENTS TO SAVE SPACE
# vim: tw=78
#
#----------------------------------------------------------------------------
Name: @PACKAGE@
Version: @VERSION@
Release: 1
License: GPL
URL: http://etherlab.org/en/ethercat
Provides: @PACKAGE@
Source: %{name}-%{version}.tar.bz2
BuildRoot: /tmp/%{name}-%{version}
BuildRequires: %kernel_module_package_buildreqs
#----------------------------------------------------------------------------
# Main Package
#----------------------------------------------------------------------------
Summary: IgH EtherCAT Master
Group: EtherLab
%description
This is an open-source EtherCAT master implementation for Linux 2.6. See the
FEATURES file for a list of features. For more information, see
http://etherlab.org/en/ethercat.
%kernel_module_package
#----------------------------------------------------------------------------
# Development package
#----------------------------------------------------------------------------
%package devel
Summary: Development files for applications that use the EtherCAT master.
Group: EtherLab
%description devel
This is an open-source EtherCAT master implementation for Linux 2.6. See the
FEATURES file for a list of features. For more information, see
http://etherlab.org/en/ethercat.
#----------------------------------------------------------------------------
%prep
%setup
%build
%configure --enable-tty --enable-generic --enable-e100 \
--with-linux-dir=/usr/src/linux-obj/%_target_cpu/default
make
mkdir obj
for flavor in %flavors_to_build; do
target=obj/$flavor
rm -rf $target
mkdir $target
cp -r config.h globals.h Kbuild master/ devices/ \
examples/ tty/ include/ $target
make -C /usr/src/linux-obj/%_target_cpu/$flavor modules M=$PWD/$target
done
%install
for flavor in %flavors_to_build; do
md5sum obj/$flavor/Module.symvers
done
make DESTDIR=${RPM_BUILD_ROOT} install
for flavor in %flavors_to_build; do
target=obj/$flavor
make -C /usr/src/linux-obj/%_target_cpu/$flavor modules_install \
M=$PWD/$target INSTALL_MOD_PATH=${RPM_BUILD_ROOT} \
INSTALL_MOD_DIR=ethercat
done
%clean
rm -rf ${RPM_BUILD_ROOT}
%files
%defattr(-,root,root)
%doc AUTHORS
%doc COPYING
%doc COPYING.LESSER
%doc ChangeLog
%doc FEATURES
%doc INSTALL
%doc NEWS
%doc README
%doc README.EoE
/etc/init.d/ethercat
/etc/sysconfig/ethercat
/usr/bin/ethercat
/usr/lib/libethercat.so*
%files devel
%defattr(-,root,root)
/usr/include/*.h
/usr/lib/libethercat.a
/usr/lib/libethercat.la
#----------------------------------------------------------------------------
This is my .spec file
#----------------------------------------------------------------------------
# REMOVED THE COMMENTS TO SAVE SPACE
#
# vim: tw=78
#
#----------------------------------------------------------------------------
Name: ethercat
Version: 1.5
Release: 1
License: GPL
URL: http://etherlab.org/en/ethercat
Provides: ethercat
Source: %{name}-%{version}.tar.bz2
BuildRoot: /tmp/%{name}-%{version}
BuildRequires: %kernel_module_package_buildreqs
#----------------------------------------------------------------------------
# Main Package
#----------------------------------------------------------------------------
Summary: IgH EtherCAT Master
Group: EtherLab
%description
This is an open-source EtherCAT master implementation for Linux 2.6. See the
FEATURES file for a list of features. For more information, see
http://etherlab.org/en/ethercat.
%kernel_module_package
#----------------------------------------------------------------------------
# Development package
#----------------------------------------------------------------------------
%package devel
Summary: Development files for applications that use the EtherCAT master.
Group: EtherLab
%description devel
This is an open-source EtherCAT master implementation for Linux 2.6. See the
FEATURES file for a list of features. For more information, see
http://etherlab.org/en/ethercat.
#----------------------------------------------------------------------------
%prep
%setup
%build
./bootstrap
%configure --enable-tty --enable-generic --enable-e100=no --enable-8139too=no --enable-static=no \
--with-linux-dir=%{_usrsrc}/kernels/%{kverrel}${kvariant:+-$kvariant}.%{_target_cpu}
echo "configure complete"
sleep 3
make
mkdir obj
for flavor in %flavors_to_build; do
target=obj/$flavor
rm -rf $target
mkdir $target
cp -r config.h globals.h Kbuild master/ devices/ \
examples/ tty/ include/ $target
make -C %{_usrsrc}/kernels/%{kverrel}${kvariant:+-$kvariant}.%{_target_cpu} modules M=$PWD/$target
done
echo "Make complete"
sleep 3
%install
for flavor in %flavors_to_build; do
md5sum obj/$flavor/Module.symvers
done
make DESTDIR=${RPM_BUILD_ROOT} install
for flavor in %flavors_to_build; do
target=obj/$flavor
make -C %{_usrsrc}/kernels/%{kverrel}${kvariant:+-$kvariant}.%{_target_cpu} modules_install \
M=$PWD/$target INSTALL_MOD_PATH=${RPM_BUILD_ROOT} \
INSTALL_MOD_DIR=ethercat
done
echo "Install complete"
sleep 3
%clean
rm -rf ${RPM_BUILD_ROOT}
%files
%defattr(-,root,root)
%doc AUTHORS
%doc COPYING
%doc COPYING.LESSER
%doc ChangeLog
%doc FEATURES
%doc INSTALL
%doc NEWS
%doc README
%doc README.EoE
/etc/init.d/ethercat
/etc/sysconfig/ethercat
/usr/bin/ethercat
%{_libdir}/libethercat.so*
%files devel
%defattr(-,root,root)
%{_includedir}/*.h
%{_libdir}/libethercat.a
%{_libdir}/libethercat.la
#---------------------------------------------------------------------------
---------- Post added at 05:04 PM CDT ---------- Previous post was at 04:59 PM CDT ----------
I tried compiling this package on openSUSE befor attempting this since it seems to be customized for that distro.
I could not make it work there either until a hero (malcomlewis) on the opensuse forum built an rpm for me.
Thats what gave me the idea to use this method to make it work on Fedora, since im not too comfortable with opensuse.
I looked alot on his .spec file while making my own...
Im having some problems building a package as an RPM. This is the first time i atempt something like this.
The package comes with a .spec file, but it is configured for openSUSE.
I altered it to fit my fedora system, and after a lot of struggling got it to build. But it still exits with an error in the install stage.
cp: cannot stat `/usr/src/kernels/2.6.33.8-149.fc13.i686/modules.order': No such file or directory
make: *** [_modinst_] Error 1
make: Leaving directory `/usr/src/kernels/2.6.33.8-149.fc13.i686'
error: Bad exit status from /var/tmp/rpm-tmp.h62rIF (%install)
I cant find anything in the .spec file that points to the modules.order dir.
On my system the modules.order file is in: /usr/src/kernels/<kernel version>/scripts/ but it is empty.
Any ideas?
Is it a matter of specifying the location of modules.order or is there something wrong with my kernel sources?
This is the original .spec file
# REMOVED THE COMMENTS TO SAVE SPACE
# vim: tw=78
#
#----------------------------------------------------------------------------
Name: @PACKAGE@
Version: @VERSION@
Release: 1
License: GPL
URL: http://etherlab.org/en/ethercat
Provides: @PACKAGE@
Source: %{name}-%{version}.tar.bz2
BuildRoot: /tmp/%{name}-%{version}
BuildRequires: %kernel_module_package_buildreqs
#----------------------------------------------------------------------------
# Main Package
#----------------------------------------------------------------------------
Summary: IgH EtherCAT Master
Group: EtherLab
%description
This is an open-source EtherCAT master implementation for Linux 2.6. See the
FEATURES file for a list of features. For more information, see
http://etherlab.org/en/ethercat.
%kernel_module_package
#----------------------------------------------------------------------------
# Development package
#----------------------------------------------------------------------------
%package devel
Summary: Development files for applications that use the EtherCAT master.
Group: EtherLab
%description devel
This is an open-source EtherCAT master implementation for Linux 2.6. See the
FEATURES file for a list of features. For more information, see
http://etherlab.org/en/ethercat.
#----------------------------------------------------------------------------
%prep
%setup
%build
%configure --enable-tty --enable-generic --enable-e100 \
--with-linux-dir=/usr/src/linux-obj/%_target_cpu/default
make
mkdir obj
for flavor in %flavors_to_build; do
target=obj/$flavor
rm -rf $target
mkdir $target
cp -r config.h globals.h Kbuild master/ devices/ \
examples/ tty/ include/ $target
make -C /usr/src/linux-obj/%_target_cpu/$flavor modules M=$PWD/$target
done
%install
for flavor in %flavors_to_build; do
md5sum obj/$flavor/Module.symvers
done
make DESTDIR=${RPM_BUILD_ROOT} install
for flavor in %flavors_to_build; do
target=obj/$flavor
make -C /usr/src/linux-obj/%_target_cpu/$flavor modules_install \
M=$PWD/$target INSTALL_MOD_PATH=${RPM_BUILD_ROOT} \
INSTALL_MOD_DIR=ethercat
done
%clean
rm -rf ${RPM_BUILD_ROOT}
%files
%defattr(-,root,root)
%doc AUTHORS
%doc COPYING
%doc COPYING.LESSER
%doc ChangeLog
%doc FEATURES
%doc INSTALL
%doc NEWS
%doc README
%doc README.EoE
/etc/init.d/ethercat
/etc/sysconfig/ethercat
/usr/bin/ethercat
/usr/lib/libethercat.so*
%files devel
%defattr(-,root,root)
/usr/include/*.h
/usr/lib/libethercat.a
/usr/lib/libethercat.la
#----------------------------------------------------------------------------
This is my .spec file
#----------------------------------------------------------------------------
# REMOVED THE COMMENTS TO SAVE SPACE
#
# vim: tw=78
#
#----------------------------------------------------------------------------
Name: ethercat
Version: 1.5
Release: 1
License: GPL
URL: http://etherlab.org/en/ethercat
Provides: ethercat
Source: %{name}-%{version}.tar.bz2
BuildRoot: /tmp/%{name}-%{version}
BuildRequires: %kernel_module_package_buildreqs
#----------------------------------------------------------------------------
# Main Package
#----------------------------------------------------------------------------
Summary: IgH EtherCAT Master
Group: EtherLab
%description
This is an open-source EtherCAT master implementation for Linux 2.6. See the
FEATURES file for a list of features. For more information, see
http://etherlab.org/en/ethercat.
%kernel_module_package
#----------------------------------------------------------------------------
# Development package
#----------------------------------------------------------------------------
%package devel
Summary: Development files for applications that use the EtherCAT master.
Group: EtherLab
%description devel
This is an open-source EtherCAT master implementation for Linux 2.6. See the
FEATURES file for a list of features. For more information, see
http://etherlab.org/en/ethercat.
#----------------------------------------------------------------------------
%prep
%setup
%build
./bootstrap
%configure --enable-tty --enable-generic --enable-e100=no --enable-8139too=no --enable-static=no \
--with-linux-dir=%{_usrsrc}/kernels/%{kverrel}${kvariant:+-$kvariant}.%{_target_cpu}
echo "configure complete"
sleep 3
make
mkdir obj
for flavor in %flavors_to_build; do
target=obj/$flavor
rm -rf $target
mkdir $target
cp -r config.h globals.h Kbuild master/ devices/ \
examples/ tty/ include/ $target
make -C %{_usrsrc}/kernels/%{kverrel}${kvariant:+-$kvariant}.%{_target_cpu} modules M=$PWD/$target
done
echo "Make complete"
sleep 3
%install
for flavor in %flavors_to_build; do
md5sum obj/$flavor/Module.symvers
done
make DESTDIR=${RPM_BUILD_ROOT} install
for flavor in %flavors_to_build; do
target=obj/$flavor
make -C %{_usrsrc}/kernels/%{kverrel}${kvariant:+-$kvariant}.%{_target_cpu} modules_install \
M=$PWD/$target INSTALL_MOD_PATH=${RPM_BUILD_ROOT} \
INSTALL_MOD_DIR=ethercat
done
echo "Install complete"
sleep 3
%clean
rm -rf ${RPM_BUILD_ROOT}
%files
%defattr(-,root,root)
%doc AUTHORS
%doc COPYING
%doc COPYING.LESSER
%doc ChangeLog
%doc FEATURES
%doc INSTALL
%doc NEWS
%doc README
%doc README.EoE
/etc/init.d/ethercat
/etc/sysconfig/ethercat
/usr/bin/ethercat
%{_libdir}/libethercat.so*
%files devel
%defattr(-,root,root)
%{_includedir}/*.h
%{_libdir}/libethercat.a
%{_libdir}/libethercat.la
#---------------------------------------------------------------------------
---------- Post added at 05:04 PM CDT ---------- Previous post was at 04:59 PM CDT ----------
I tried compiling this package on openSUSE befor attempting this since it seems to be customized for that distro.
I could not make it work there either until a hero (malcomlewis) on the opensuse forum built an rpm for me.
Thats what gave me the idea to use this method to make it work on Fedora, since im not too comfortable with opensuse.
I looked alot on his .spec file while making my own...