I have used alien before, but today I found a new feature that makes it infinitely more useful. With this new switch and a few minutes of my time I have converted every one of my personal debs to RPM packages.
The switch? -g
What this does is generate a build tree, when you use it with -r it will extract a deb, and generate the spec file which can then be edited and used to build an RPM.
To convert my entire software library from deb to rpm I used the following simple scripts:
Extract and build specs for all deb files in the directory:
for i in *deb; do alien -r -g -c $i done
Change to an extracted directory, and edit the .spec to suit.
Build an i386 and x86_64 RPM with the following simple script:
#!/bin/bash
DIR=$(pwd | sed s#/.*/##)
SPEC=$(ls | grep spec)
if [[ ! "$SPEC" =~ "$DIR" ]]; then
echo "[$DIR] [$SPEC]"
echo "Please enter the build directory"
exit 1
else
for i in i386 x86_64
do
rpmbuild --buildroot=$(pwd) -bb --target $i $SPEC
done
fi
I was able to convert about a dozen debs in less than an hour, including the time to install them in Fedora to test that they worked.

Sign In
Register
Help





MultiQuote













