Symlink make as gmake on Mac - gnu-make

I am running a program (OpenModelica OMEdit 1.18.0~dev-109-ged8ef0a) which requires gmake for one of its operations. gmake is not installed on my Mac (Big Sur 11.5.2) but make is. I tried to symlink gmake to point at make but it does not work:
➜ where make
/usr/bin/make
➜ make -v | HEAD -n 1
GNU Make 3.81
➜ pwd
/opt/openmodelica/bin
➜ sudo ln -s /usr/bin/make /opt/openmodelica/bin/gmake
➜ ls -lh gmake
lrwxr-xr-x 1 root wheel 13B 13 Dec 09:15 gmake -> /usr/bin/make
➜ /opt/openmodelica/bin/gmake -v
gmake: error: sh -c '/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -find gmake 2> /dev/null' failed with exit code 17664: (null) (errno=Invalid argument)
xcode-select: Failed to locate 'gmake', requesting installation of command line developer tools.
It prompts each time to install the XCode command line developer tools which I have already done. From the error message it looks like it is trying to find gmake despite pointing at the make executable? (Why is it erroring?) Is there a way to get this to work as I was expecting or do I have to install gmake using brew then symlink to that?
Command line tools version:
➜ pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
package-id: com.apple.pkg.CLTools_Executables
version: 12.5.1.0.1.1623191612
volume: /
location: /
install-time: 1639360537
groups: com.apple.FindSystemFiles.pkg-group
** edit **
I'm using zsh 5.8 (x86_64-apple-darwin20.0), I don't know if that's a factor in the gmake symlink to make not working correctly?

I don't understand why this works but from #Holger Just's comment:
➜ brew install make
This will add a symlink:
➜ ls -lh /usr/local/bin/gmake
/usr/local/bin/gmake# -> ../Cellar/make/4.3/bin/gmake
And then symlinking to that instead:
➜ sudo ln -s /usr/local/bin/gmake /opt/openmodelica/bin/gmake
... works as expected:
➜ /opt/openmodelica/bin/gmake -v | head -n 1
GNU Make 4.3

Related

bash: eksctl: command not found. in centos 7

I installed the eksctl with the help of this https://docs.aws.amazon.com/eks/latest/userguide/getting-started-eksctl.html.
Commands I executed:-
curl --silent --location "https://github.com/weaveworks/eksctl/releases/download/0.26.0-rc.1/eksctl_Linux_amd64.tar.gz" | tar xz -C /tmp
sudo mv /tmp/eksctl /usr/local/bin
Output:-
[shivani#vmunix ~]$ eksctl version
0.26.0-rc.1
[root#vmunix ~]# eksctl version
bash: eksctl: command not found...
Please help me to resolve this issue.
In case your issue is not resolved ,set the path as below :
Assuming eksctl binary is in /usr/local/bin:
export PATH=$PATH:/usr/local/bin/
It is working for me, we need to set a variable on the .bash_profile file
[root# ~]# eksctl version
0.126.0

Trial AppDynamics package fails to install

Getting below error during platform installation:
"Required libaio package is not found. ..."
However, above package is already installed:
rpm -q libaio
libaio-0.3.107-10.el6.x86_64
Here is output from the installation script:
./platform-setup-x64-linux-4.4.3.10393.sh
Unpacking JRE ...
Preparing JRE ...
Starting Installer ...
May 30, 2018 6:51:23 PM java.util.prefs.FileSystemPreferences$2 run
INFO: Created system preferences directory in java.home.
Verifying if the libaio package is installed. /opt/appdynamics/platform/installer/checkLibaio.sh
I got this too... I was running from command-line as a non-root user:
./platform-setup-x64-linux-4.4.3.10393.sh -q -varfile /appd/home/Install/response.varfile
I added the shell expand(-x) switch and log to the command(s) like so:
bash -x ./platform-setup-x64-linux-4.4.3.10393.sh -q -varfile /appd/home/Install/response.varfile > install.log 2>&1
If we tail the last bit of that log you get, this response in debug mode:
Verifying if the libaio package is installed. /opt/appdynamics/platform/installer/checkLibaio.sh
Required libaio package is not found. For instructions on installing
the missing package, refer to https://docs.appdynamics.com/display/PRO44/Enterprise+Console+Requirements
and the script checkLibaio.sh isn't left there... so you cannot figure it out easily. I also have a RedHat variant with the packages installed:
rpm -qa | grep libaio
libaio-0.3.109-13.el7.x86_64
Strangely enough I have one VM from the same image that will install the distribution just fine, and one that will not, so on the broken install (where I really want to install this). I ran another command from the expanded view of the install.log, which was a really long JVM command line. Anyways I got it to work and then made a looping script to retrieve the file (Because AppD for some reason removes the check script before you can look at it). The script is as follows:
#!/bin/sh
# Script used to check if the machine has libaio on it or not.
cat /dev/null > /opt/appdynamics/platform/installer/.libaio_status
chmod 777 /opt/appdynamics/platform/installer/.libaio_status
# Check if the dpkg or rpm command exists before running it.
command -v dpkg >/dev/null 2>&1
OUT=$?
if [ $OUT -eq 0 ];
then
if [ `dpkg -l | grep -i libaio* | wc -l` -gt 0 ];
then
echo SUCCESS >> /opt/appdynamics/platform/installer/.libaio_status
exit 0
fi
else
command -v rpm >/dev/null 2>&1
OUT=$?
if [ $OUT -eq 0 ];
then
if [ `rpm -qa | grep -i libaio* | wc -l` -gt 0 ];
then
echo SUCCESS >> /opt/appdynamics/platform/installer/.libaio_status
exit 0
fi
fi
fi
echo FAILURE >> /opt/appdynamics/platform/installer/.libaio_status
exit 1
I you run this script like me on the faulty platform what you will discover is that your version of Linux has both:
dpkg
and
rpm
installed. To work around this you should temporarily make a name change to one of these two package manager executables so it cannot be found (by your shell environment).
Most common here will be that you are running a RedHat variant where someone chose to install dpkg (For who knows what reason). If so desired remove that package and the install should be successful.

How to change %install section in spec file?

I tried to build binaries in RHEL6 using rpmbuild command.It throws file not found error during rpmbuild command execution. But In RHEL5 the same rpmbuild command is working fine.
RHEL5 execution result:
*Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.77266
umask 022
cd /usr/src/redhat/BUILD
LANG=C
export LANG
unset DISPLAY*
RHEL6 execution result:
*Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.BeMhyH
umask 022
cd //rpmbuild/BUILD
'[' //rpmbuild/BUILDROOT/ '!=' / ']'
rm -rf //rpmbuild/BUILDROOT/
++ dirname //rpmbuild/BUILDROOT/
mkdir -p //rpmbuild/BUILDROOT
mkdir //rpmbuild/BUILDROOT/
LANG=C
export LANG
unset DISPLAY
/usr/lib/rpm/check-buildroot*
I am not able to find any %install changes between the spec files. Any one please help me to understand what am i doing wrong?
Thanks in Advance..!
The only problem that is clear from the snippets provided is that $HOME is not defined in your rpmbuild environment. $HOME/rpmbuild is the default build root for 'rpmbuild' in RHEL6, instead of /usr/src/redhat as in RHEL5.
Things to consider:
Is there an '~/.rpmmacros' file that is altering the rpmbuild
directives.
The temporary %install script will not be deleted on
error-exit. Inspecting it directly might tell you more about why it failed.
Ex:
[user#host rpmbuild]$ rpmbuild -bb nano
<snip>
+ exit 1
error: Bad exit status from /var/tmp/rpm-tmp.2uw1tZ (%install)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.2uw1tZ (%install)
[user#host rpmbuild]$ cat /var/tmp/rpm-tmp.2uw1tZ
#!/bin/sh
RPM_SOURCE_DIR="/home/user/rpmbuild/SOURCES"
RPM_BUILD_DIR="/home/user/rpmbuild/BUILD"
...
Older recommendations were to nuke the target buildroot as the first step of %install. To help force a separation between the %build and %install steps, newer versions of rpmbuild strictly enforce it by doing it for you for the first step, as shown in what you pasted in.
I am assuming that your %build stage is putting one or more files into the target buildroot area, which it shouldn't be doing. It should all be in the build area only.

Debian packaging rules

When I tried to make a link inside the rules file it didn't allow me.How can I make it?
Here is what I did.
#!/usr/bin/make -f
icon = $(CURDIR)/frontpage.png
script = $(CURDIR)/guilotinga.py
launcher = $(CURDIR)/internation.desktop
DEST1 = $(CURDIR)/debian/internation/usr/share/internation
DEST2 = $(CURDIR)/debian/internation/usr/share/applications
build: build-stamp
build-stamp:
dh_testdir
touch build-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp
dh_clean
install: build clean $(icon) $(script) $(launcher)
dh_testdir
dh_testroot
dh_prep
dh_installdirs
mkdir -m 755 -p $(DEST1)
mkdir -m 755 -p $(DEST2)
install -m 666 $(icon) $(DEST1)
install -m 777 $(script) $(DEST1)
install -m 777 $(launcher) $(DEST2)
ln -s usr/share/internation/guilotinga.py /usr/bin/internation
(That's where I stopped)
The line above is giving error saying I don't have enough privileges.What was my fault?
binary-indep: build install
dh_testdir
dh_testroot
dh_installchangelogs
dh_installdocs
dh_installexamples
dh_installman
dh_link
dh_compress
dh_fixperms
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
binary-arch: build install
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
I'm assuming that what you wanted was to make a symlink to /usr/bin/internation, and have the link show up as /usr/share/internation/guilotinga.py when the package is installed. If so, you're just giving the link command backwards. You want
ln -s /usr/bin/internation usr/share/internation/guilotinga.py
As a further note, though, symlinks in Debian packages should not ever be absolute, unless you're symlinking one toplevel directory to another (see Debian Policy section 10.5).
In your case, you probably don't need to change anything, since you have a call to dh_link in your build script. That tool will automatically fix noncompliant symlinks in the package build area (unless you're running in a super-ancient debhelper compat mode).
But if you want to avoid potentially confusing readers (or yourself), perhaps you ought to do
ln -s ../../bin/internation usr/share/internation/guilotinga.py

Error installing Meteor on linux x86_64 chrome os

I am trying to install Meteor on the HP14 Chromebook. It is a linx x86_64 chrome os system.
Each time I try to install it I run into errors.
The first time I tried to install it the installer just downloaded the Meteor preengine but never downloaded the tarball or installed the actual meteor application structure.
So, I decided to try as sudo.
sudo curl https://install.meteor.com | /bin/sh
This definitely installed it because you can see it when ls
chronos#localhost ~/projects $ chronos#localhost ~/projects $ ls /home/chronos/user/.meteor/
bash: chronos#localhost: command not found
Now when I try to run meteor --version or meteor create myapp without sudo I get the following error.
````
chronos#localhost ~/projects $ meteor create myapp
'/home/chronos/user/.meteor' exists, but '/home/chronos/user/.meteor/meteor' is not executable.
Remove it and try again.
````
When I try to run sudo meteor --version or sudo meteor create myapp I get this error.
chronos#localhost ~/projects $ sudo meteor create myapp
mkdir: cannot create directory ‘/root/.meteor-install-tmp’: Read-only file system
Any ideas? Thinking I have to make that partition writeable. I made partition 4 writeable.
Put your chrome book into dev mode.
http://www.chromium.org/chromium-os/developer-information-for-chrome-os-devices
Boot into dev mode.
ctrl-alt t to crosh
shell
sudo su -
cd /usr/share/vboot/bin/
./make_dev_ssd.sh --remove_rootfs_verification --partitions 4
reboot
After rebooting
sudo su -
mount -o remount,rw /
mount -o remount,exec /mnt/stateful_partition
Write yourself a read/write script
sudo vim /sbin/rw
#!/bin/bash
echo "Making FS Read/Write"
sudo mount -o remount,rw /
sudo mount -o remount,exec /mnt/stateful_partition
sudo mount -i -o remount,exec /home/chronos/user
echo "You should now have full Read/Write access"
exit
Change permissions on script
sudo chmod a+x /sbin/rw
Run to set read/write root
sudo rw
Install Meteor as indicated on www.meteor.com via curl and meteor create works!
Alternatively you can edit the chomeos_startup though that might not be the best idea. It is probably best to have read/write on demand as illustrated above.
cd /sbin sudo
sudo vim chromeos_startup
Go to lines 51 and 58 and remove the noexec options from the mount command.
Down at the bottom of the script, above the note about ureadahead and below the if statement, add in:
mount -o remount,exec /mnt/stateful_partition
#uncomment this to mount root r/w on boot
mount -o remount,rw /
Again, editing chromeos_startup probably isn't the best idea unless you are so lazy you can't type sudo rw.
Enjoy.
This is super easy to fix!!
Just run this (or put it in .bashrc or .zshrc to make it permanent):
sudo mount -i -o remount,exec /home/chronos/user
Based on your question (you are using sudo) I assume you already have Dev Mode enabled, which is required for the above sudo command to work.
ChromeOS mounts the home folder using the noexec option by default, and this command remounts it with exec instead. And boom, Meteor will work just fine after that (and so will a bunch of other programs running out of your home folder).
Original tip: https://github.com/dnschneid/crouton/issues/928

Resources