Skip to content

Enhance Makefile for library and program installation on Linux#73

Open
UlyssesApokin wants to merge 6 commits intovarnamproject:masterfrom
UlyssesApokin:master
Open

Enhance Makefile for library and program installation on Linux#73
UlyssesApokin wants to merge 6 commits intovarnamproject:masterfrom
UlyssesApokin:master

Conversation

@UlyssesApokin
Copy link

Fix Makefile for library and program installation on Linux
This is a continuation of the discussion #69
Compared to last time, I tried to keep the number of changes to a minimum. I also made several smaller commits instead of one large patch.
Our distribution is already using these changes in production. We'd like to push them upstream.
See: https://packages.altlinux.org/en/sisyphus/srpms/libgovarnam/specfiles/

  • Added support for traditional Makefile macros:
    • DESTDIR
    • PREFIX
    • BINDIR
    • INCLUDEDIR
    • LIBDIR
    • PKGCONFIGDIR
  • Installation is now handled directly from the Makefile
  • Removed requirement for sudo during installation
  • Removed dependency on git during build
  • Corrected the creation of the govarnam.pc file
  • Improved code readability

Fix govarnam.pc file

  • Used traditional macros:

Ulysses Apokin added 6 commits December 25, 2025 11:45
During sandbox build there is no access to git history.
The library binary file should look like this:
libname.so.X.Y.Z
And the files libname.so.X and libname.so should be symlinks
to it.
Libraries can be installed not only in /usr/lib.
For example, in /usr/lib64. And so on.
Installation from install.sh looks non-native and pointless,
and also has a number of significant drawbacks. Using sudo
in the installation script is a very bad practice. This is
due to the fact that not all Linux distributions have sudo
installed and configured. Thus, this is an unnecessary build
dependency. Also, in those distributions where sudo is "prepared
out of the box", there is no guarantee that a password timeout is
configured. However, these drawbacks are insignificant compared to
the fact that this is a security violation. Elevating the rights of
an unprivileged user is the same as constantly working with root
rights. Because if an intruder has access to an unprivileged user,
then he will be able to access the entire system. I would also like to
add that not all sandboxes for building packages allow user elevation.
@UlyssesApokin
Copy link
Author

Guys, don't you care about your program? The problem clearly exists. It needs to be fixed. It needs to be fixed. If you don't like my solution, then do it your way. You need to move the installation from the bash script to the Makefile. You need to remove the use of sudo!!! You need to remove the use of git history!!!! You need to fix the library installation location; it's not always /usr/lib!!! You need to use https instead of http in the pkgconfig file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant