log installed files when compiling - linux

im currently building LFS and looking for a package management solution
specifically a program that keeps track of what files got installed when you compiled
something from source also has a method for removing those files in case make uninstall isnt present
i have looked into programs like install-log and checkinstall but couldnt get both to compile
any help is appreciated, thanks!

Personally, I have always used the User Based Management (aka "Package Users"), as described in section 8.2. Package Management. It doesn't get much love, even from the LFS community, despite it (still) being in the book and being the only method "unique to LFS".
It's not great for the first timer as it will really force you to dig deep at times to solve issues and make important decisions. I suggest you complete your first LFS system build, then consider Package Users your next time around.
But once you get used to it, it works great.
Another, simpler, method is the Timestamp Based technique (described in the same link).
For example, when it comes time to copy a package's files to your system, you can do something like this:
touch timestamp_start
make install
# do other stuff as instructed
touch timestamp_stop
find / -newer timestamp_start -not -newer timestamp_stop > list_of_files_affected
And I do use this approach when installing the Nvidia proprietary drivers, because successfully installing them with a non-root account is a real pain.

Related

autoconf and sysvinit/systemd etc

A constant problem I run into with autoconf is init scripts. The whole point of autoconf is of course portability, and the various init systems (sysvinit, systemd, upstart) - not to mention various differences between the same init system on different distros (like /etc/init.d vs /etc/rc.d/ vs /etc/rc.d/init.d) - are crying out for a portable start/stop script solution.
I thought that someone would have created a nice m4 macro by now that handles this, but I can't find one.
This is strange because it seems like a common problem, and they even have m4 macros now to detect much newer issues like C++11 compatibility and other things.
So, before I roll up my sleeves and spend the time to make a (hopefully) decent m4 macro that tries to determine what init system to use, I'd be interested in knowing if someone else has already done it better. I can't seem to find anything on Google - and I've even read posts where people actually discourage using autoconf to install init scripts. Personally, I think that sentiment is simply impractical - users these days are used to package managers automatically installing init scripts, so there's no reason that you shouldn't get the same when compiling from source.
So, is there already a good m4 macro that handles this, or should I spend the time to write my own?

Installing GLPK (GNU Linear Programming Kit) on Windows

This could be an annoying question. But I was hoping someone could provide me with step by step instructions on how to get GLPK up and running on a Windows machine. I have Windows 7 64-bit.
I have tried looking at some instructions on various websites but keep running into problems. I am not very versed in creating directories, working with binaries (e.g. what is a binary), etc.... Even running commands is a little foreign to me.
To get an idea of what kind of detail I need in the instructions, here are some I have tried (and failed) to use:
http://winglpk.sourceforge.net/
http://en.wikibooks.org/wiki/GLPK/Windows
As you can see, I need something fairly detailed. I have read an example of a GLPK program in action, and I believe that once I get the program up and running I should be able to write the code to use it.
Can anyone help me? I would be so grateful.
EDIT: As a parallel question, I would also be interested in suggestions for other programs that will do the similar things as GLPK, but are more straightforward to install and use.
here an easy step-by-step explanation of "how to make glpk work":
To download GLPK , first go to the GLPK windows download page and then follow the instructions here from 1:
Go to control panel to determine whether you have 32-bit or 64-bit Windows (assume 64-bit from now on).
Download the latest version of GLPK, 4.65 at the time of writing, from the following address Sourceforge.
Extract the Zip folder by: right clicking on the folder and then>> 7-Zip >> Extract Here as shown. Move the glpk-4.65 folder from your downloads folder to your C: drive.
Assuming you’re using 64-bit Windows, click on the C:\glpk-4.65 folder in Windows explorer, click on the w64 folder, and select and copy the file path, which should be C:\glpk-4.65\w64.
Search and open your Control Panel, select System and Security>>System>>Advanced system settings>>Environment Variables. Then click on ‘path’ in the top window, click the ‘Edit’ button, then ‘New’.
Paste the file path you copied above and save.
DONE.
Here are a few suggestions to get you moving forward:
If you are having difficulty with running Windows command-line, then maybe GLPK (installing by yourself) is not the best bet.
See if you can find someone more experienced in Windows help you with the installation? (Once installed the LP modules are fairly easy to use, no more complex than any of the others)
Do you have access to any commercial solvers? (MATLAB and CPLEX can be great)
If you are going to be working with Windows for some time to come, it is a good idea to invest some time to learn how to download and install software
This SO question has links to lots of other LP/IP solvers such as Gurobi and COIN-OR.
If you don't mind learning a bit of R programming language, I'd recommend downloading R and RStudio, both of which are straightforward. Next, what you want is the lpSolveAPI package. The examples are decent and you can get going in a day or two. (You'll have to learn the basics of R)
If none of these help you progress, post some details of where you are getting stuck in the GLPK download (post the errors you are getting) and someone will try and assist you.
Hope that helps
In my opinion, it would be way easier for you to install e.g. ubuntu, especially if you are interested in other GNU programs. You can use every open-source program on windows, but it will not be easy if you don't understand what is a "search path for binaries"...
Installing softwares and libraries on windows is not easy, which is why windows program usually come with a setup.exe installer that does everything for you (but GNU programs don't).
On the other hand, ubuntu has a beginner-friendly documentation, and once you have installed it on your computer (it won't take you more than 2 hours at most, and 10G of disk space), installing GLPK or any GNU program is pretty straigtforward (just type sudo apt-get install glpk on the command-line).
There is no drawback in having the two systems on the same computer (except for the small amount of disk space used), and getting to know another operating system will certainly teach you more than following any step-by-step guide anyway.
That would be my "general advice". Now if you just want help on how to install glpk on windows, please post more details about what "doesn't work" for you (where did you "failed" to use those instruction? what happened?) because I don't think you can find something more detailed than the second link you posted.
have you set the PATH correctly once you have unziped the files?
To check it, run the cmd.exe and put "echo %path%", if in the list does not appears your glpk folder then you are unnable to execute it right since windows does not find the glpk executables.
more info:
http://en.wikibooks.org/wiki/GLPK/Windows_executables
https://superuser.com/questions/284342/what-are-path-and-other-environment-variables-and-how-can-i-set-or-use-them

How can one make a private copy of Hackage

I'd like to snapshot the global Hackage database into a frozen, smaller one for my company's deploys. How can one most easily copy out some segment of Hackage onto a private server?
Here's one script that does it in just about the simplest way possible: https://github.com/jamwt/mirror-hackage
You can also use the MirrorClient directly from the hackage2 repo: http://code.haskell.org/hackage-server/
This is not an answer two the question in the title but an answer to my interpretation of what the OP wish to achieve.
Depending of what you want for level of stability in your production circle you can approach the problem in several ways.
I have split the dependencies in two parts, things that I can use that are in the haskell platform (keep every platform used in production) and then only use a small number of packages outside that and don't let anyone (including yourself) add more packages into your dependency tree just because of laziness (as developer). These extra packages you use some kind of script for and collect from hackage (lock to version) by using cabal fetch. Keep them safe. Create a install script that uses your safe packages and if a new machine (developer) are added to your team, use that script.
yackage is great but it all comes down to how you ship your product. If you have older versions in production you need to have a yackage setup for every version and that could be quiet annoying after a couple of years.
You can download Hackage with Voker57's hackage-mirror.sh. You'll need 'curl' for it to run. If you're using a Debian based Linux distribution, you can install curl by typing apt-get install curl.
Though it's not a segment of Hackage, I've written a bash script, that downloads the whole Hackage, what can be further easily set up as a mirror using an HTTP server. Also, it downloads all required stuff like GHC compilers ready to be used with Stack.
Currently, a complete Hackage mirror occupies ~10GiB (~100000 packages of all versions) and Stack related stuff like GHC compilers ~21GiB (~200 files). Consequent runs of the script skip already downloaded stuff, so it downloads only new one. So it's a pretty convenient way to "live offline" and sync up to date when online.

Permission problems creating a .deb file

I'm trying to create a .deb file from a binary and support files. It works, however I get the following warning before I create it:
The installation of a package which violates the quality standards isn't allowed.
This could cause serious problems on your computer.
Please contact the person or organisation who provided this package
file and include the details beneath.
Lintian check results for /home/javaherd/program-5/debian/program-5_1.4.2_i386.deb:
E: program-v5: control-interpreter-without-depends control/rules #!/usr/bin/make
E: program-v5: wrong-file-owner-uid-or-gid usr/local/include/titles.txt 1006/1007
E: program-v5: wrong-file-owner-uid-or-gid usr/local/include/counties.txt 1006/1007
What can I do to rectify this situation?
Software is relatively easy to package for Debian and Ubuntu, but somewhat harder to package correctly. The result is that there are a lot of incorrectly packaged, unofficial *.deb packages floating around out there.
Here is how to address the problem. First, extract the contents of the archive into a new directory program by dpkg-deb -x program-5_1.4.2_i386.deb program. Second, look in the new directory program to see what's in there; for, if you find what you need, it may solve your problem right there. Finally, apply the lintian command to the *.deb package, itself, by lintian program-5_1.4.2_i386.deb, which is likely to give you useful information about how the package was mispackaged in the first place (of course, you may have to install lintian first).
It is possible that lintian, so invoked, will only repeat the information it has already given you, but lintian can be invoked in several, different ways; so, now that you know how to invoke it manually, you can read the manpage and experiment.
If you do these things, they will give you much more information to lead you to a complete solution of your problem. Good luck.

How to setup a webserver in common lisp?

Several months ago, I was inspired by the magnificent book ANSI Common Lisp written by Paul Graham, and the statement that Lisp could be used as a secret weapon in your web development, published by the same author on his blog. Wow, that is amazing. That is something that I have been looking for long time. The author really developed a successful web applcation and sold it to Yahoo.
With those encouraging images, I determined to spend some time (1 year or 2 year, who knows) on learning Common Lisp. Maybe someday I will development my web application and turn into a great Lisp expert. In fact, this is the second time for me to get to study Lisp. The first time was a couple of years ago when I was fascinated by the famous book SICP but found later Scheme was so unbelievably immature for real life application.
After reading some chapters of ANSI Common Lisp, I was pretty sure that is a great book full of detailed exploration of Common Lisp. Then I began to set up a web server in Common Lisp. After all, this should be the best way if you want to learn something. Demonstrations are always better than definations.
As suggested by the book Practical Common Lisp (by the way, this is also a great book), I chose to install AllegroServe on some Common Lisp implementation. Then, from somewhere else, I learned that Hunchentoot seems to be better than AllegroServe. (I don't remember where and whom this word is from. So don't argue with me.)
Ironically, you know what, I never could installed the two packages on any Common Lisp implementation. More annoyingly, I even don't know why. The machine always spit up a lot of jargon and lead me into a chaos. I've tried searching the internet and have not found anything.
Could anybody who has successfully installed these packages in Linux tell me how you did it? Have you run into any trouble? How did you figured out what is wrong and fixed it? The more detailed, the more helpful.
Have you tried these instructions?
I already had a working SBCL installation so I've only followed the second half of the instructions. It sets up a very minimal web app, so it lets you see just how to structure your own web app.
These instructions might not be quite what you're looking for - they're for setting up a web server (on Ubuntu) with remote interaction with emacs/SLIME, but I guess "remote interaction" could just as well mean localhost.
Basically, these installation steps are from this article A Simple Lisp Webapp for beginners, recommended by Frank Shearar (thanks again). But I didn't follow the exact steps because (1) I'd like to install Common Lisp with a local user; (2) I am not familiar with a few things the author mentioned. You can check out the original article or you can just follow me here. I am afraid my instructions are much easier to follow. :)
Three packages need to be downloaded before installation. sbcl binary and source packages can be downloaded here, and smanek package can be downloaded here.
sbcl-1.0.38-x86-linux-binary.tar.bz2
sbcl-1.0.38-source.tar.bz2
smanek-trivial-lisp-webapp-3681c1
Note: The version number may have changed when you see this essay. So don't bother to get the exact packages. However, this is right packages working for me.
Here is what I do (replace YOURPATH with your real path and I assume you are using BASH):
1. Install the binary sbcl package
tar jxf sbcl-1.0.38-x86-linux-binary.tar.bz2
cd sbcl-1.0.38-x86-linux
INSTALL_ROOT=YOURPATH sh install.sh
cd ..
Well, the binary sbcl package has been installed now. When the install program complains with something like "no manual found", it is OK since the manual stuff is not included in the binary package. Let it be.
2. Set the PATH and SBCL_HOME
export PATH=YOURPATH/bin/:$PATH
export SBCL_HOME=YOURPATH/lib/sbcl/
3. Install the source sbcl package
tar jxf sbcl-1.0.38-source.tar.bz2
cd sbcl-1.0.38
sh make.sh
export SBCL_HOME=''
INSTALL_ROOT=YOUROTHTERPATH sh install.sh
cd ..
NOTE: You may need to specify another directory for installation, or it will be installed into the same directory the binary sbcl resides in.
4. Set the PATH and SBCL_HOME
export PATH=YOUROTHERPATH/bin/:$PATH
export SBCL_HOME=YOUROTHERPATH/lib/sbcl/
5. Install the smanek package
unzip smanek-trivial-lisp-webapp-36816c1.zip
cd smanek-trival-lisp-webapp-36816c1
cd scripts
./startserver.sh
When it says "Webserver started on port 8080", you can visit "http://localhost:8080" in your web browser. It is there, right?
6. A few notes
After putting the three packages in one directory, you can run the above scripts one by one or in a batch. Remember to replace the PATHs with your real paths.
I suspect Shaneal Manek has hacked the asdf and hunchentoot packages a lot, as I didn't find anything in the $HOME/.sbclrc and $HOME/.sbcl. Thank you, Shaneal Manek, you've helped a lot of people a lot.
I still feel hateful toward those who always says a lot but does a little. Even people are angry, it is still evident that it is what they say matters, not how they say it. Nevertheless, I was wrong to say something bad in a bad mood.
5 years later.
it very easy with quicklisp. I assume you have installed SBCL or other CL implementation.
Go to your REPL and evalute
(ql:quickload :aserve)
start AllegroServe
(net.aserve:start :port 8000)
publish some HTML files
(net.aserve:publish-file :path "/" :file "~/hello.html")
Go to http://localhost:8000/
Happy hacking!.
read more about Introduction to AllegroServe Tutorial
Paul Graham has, for starters :-)
I too have found Common Lisp a lot of work to get past step one. The environment is terrible when you're just getting started, there's not a clear One True Path to get to the point where you can bang in some code and see some results (like there is with Python, for example). Like you, I wasted a lot of time jumping from one implementation to another. So my advice is:
I suggest you just pick one and ignore all other advice until you get it going.
If you're not in the mood, just get Apache and write some PHP :-)

Resources