Sunday, May 5, 2024
6
rated 0 times [  6] [ 0]  / answers: 1 / hits: 2016  / 1 Year ago, mon, may 22, 2023, 4:32:53

What is the Ubuntu way of downloading the source for a package and then building it while passing specific flags to the configure portion of the process? I hope I'm explaining what I mean properly.



Installing from source follows almost always the following procedure:



./configure --FLAG-1 --FLAG-2
make && make install


How can I get control over specifying flags1 and 2 in the configure process?


More From » package-management

 Answers
7

You can download the source for most packages in the Ubuntu Repos. To compile a package from source, you would do something like this:



sudo apt-get build-dep doodad


This will install any dependencies. Now download the source code:



apt-get source doodad
cd doodad*


Edit debian/rules to customize the build process:



$EDITOR debian/rules


Finally, build it as a .deb (for easy uninstalling/dependency resolution):



dpkg-buildpackage -rfakeroot -uc -b


(the arguments will tell the command to fake root, to not sign the package, and to not include the source)



Now you can install the package you just built with this command:



cd ..
sudo dpkg -i doodad-<version>-ubuntu-<crap>.deb


(make sure to install the non -dev version)



Then you can clean up with:



rm -rf doodad*


This was tested on Ubuntu 12.04, with the irssi package. Your results may vary.


[#35596] Tuesday, May 23, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
raacket

Total Points: 198
Total Questions: 114
Total Answers: 111

Location: Czech Republic
Member since Mon, May 15, 2023
1 Year ago
raacket questions
;