Name: luarocks Version: 2.0.1 Release: 1%{?dist} Summary: Package management system for Lua modules and Libraries Group: Development/System License: MIT URL: http://www.luarocks.org/ Source0: http://luarocks.org/releases/%{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %define luaver 5.1 #LuaRocks is _not_ arch-independant, due to toolchain differences ExclusiveArch: x86, x86_64 #BuildArchitectures: noarch # Untested architectures: ARM, IA64, Parisc, ppc, ppc64, S390, SPARC BuildRequires: lua-devel >= %{luaver} BuildRequires: luadoc Requires: lua >= %{luaver} Requires: wget Requires: zip # LuaRocks is arch-dependant, however there's no debug-info since it's pure Lua %global debug_package %{nil} %define prefix /usr %define downloader wget %define md5checker md5sum %define manifest /%{prefix}/lib/luarocks/rocks/manifest %description This package contains LuaRocks, a command-line tool for managing Lua rocks. A rock is a compressed folder containing a Lua module and metadata mandatory for the compilation and installation process. It can be either written in C, Lua or both at the same time. LuaRocks manages fetching, installing and removing rocks and handles dependencies between rocks. Rocks are installed system-wide so that they can be used by any Lua application. This package also provides the admin tool to manage a LuaRocks repository, along with the LuaRocks documentation Note that most rocks require to have lua-devel installed on your system. # ### ### ### ### # Prep # ### ### ### ### %prep %setup -q -n %{name}-%{version} #Make sure COPYING is in utf8 iconv -f ISO-8859-1 -t UTF-8 -o COPYING.new COPYING && \ touch -r COPYING COPYING.new && \ mv COPYING.new COPYING # ### ### ### ### # Build # ### ### ### ### %build # ### ### ### ### ## pt1 - Executable # ### ### ### ### # Can't use configure macro here since configure script fails with unsupported # options ./configure \ --prefix="%{prefix}" \ --sysconfdir="%{_sysconfdir}/%{name}/" \ --with-lua="%{prefix}" \ --with-lua-include="%{_includedir}" \ --with-lua-lib="%{_libdir}" \ --with-downloader="%{downloader}" \ --with-md5-checker="%{md5checker}" \ --force-config="%{prefix}" make # Generate an empty manifest, since luarocks no longer provides one touch manifest echo 'modules = {}' >> manifest echo 'commands = {}' >> manifest echo 'repository = {}' >> manifest # ### ### ### ### ## pt2 - Documentation # ### ### ### ### # Builds HTML documentation make luadoc # Generates manpages since luarocks doesn't provide any #cd src && \ #help2man bin/%{name} -N > ../%{name}.1 && \ #help2man bin/%{name}-admin -N > ../%{name}-admin.1 && \ #cd .. && \ #gzip -9 %{name}.1 && \ #gzip -9 %{name}-admin.1 # ### ### ### ### # Install # ### ### ### ### %install rm -rf %{buildroot} make install DESTDIR=%{buildroot} %{__mkdir} -p %{buildroot}/%{prefix}/lib/luarocks/rocks cp -pr manifest %{buildroot}/%{manifest} %{__mkdir} -p %{buildroot}/%{_defaultdocdir}/%{name}-%{version} #%{__mkdir} -p %{buildroot}/%{_mandir}/man1 #cp -pr *.1.gz %{buildroot}/%{_mandir}/man1 # LuaRocks always install rocks into /usr/lib, so we add a symlink for x86_64 %ifarch x86_64 %{__mkdir} -p %{buildroot}/%{prefix}/lib/lua/ %{__mkdir} -p %{buildroot}/%{_libdir}/lua/%{luaver} ln -s %{_libdir}/lua/%{luaver} %{buildroot}/%{prefix}/lib/lua/ %endif # ### ### ### ### # Clean # ### ### ### ### %clean rm -rf %{buildroot} # ### ### ### ### # Files # ### ### ### ### %files %defattr(644, root, root, 755) %attr(755, root, root) %{_bindir}/%{name} %attr(755, root, root) %{_bindir}/%{name}-admin %dir %{_sysconfdir}/%{name} %config(noreplace) %{_sysconfdir}/%{name}/config.lua %{manifest} %doc COPYING doc/luadoc %dir %{_datadir}/lua/5.1/%{name} %{_datadir}/lua/5.1/%{name}/* #%{_mandir}/man1/* %ifarch x86_64 %dir %{prefix}/lib/lua/ %{prefix}/lib/lua/%{luaver} %endif %changelog * Sun Mar 07 2010 Duboucher Thomas - 2.0.1-1 - Initial packaging