1st time making SPEC File.

Issues related to applications and software problems
supertight
Posts: 171
Joined: 2017/02/07 21:47:51

1st time making SPEC File.

Post by supertight » 2018/01/28 01:45:28

I'm trying to make an rpm package for xmr-stak-cpu.

This is what I have in the spec file:

Code: Select all

Name:           xmr-stak
Version:        cpu.tgz
Release:        0
Summary:        CPU miner monero/aeon.
Group:          miner
License:        GPL
URL:            https://github.com/fireice-uk/xmr-stak-cpu
Vendor:         fireice-uk
Source:         http://basic.p.local/software/xmr-stak-cpu.tgz
Prefix:         %{_prefix}
Packager:       Karthik
BuildRoot:      %{_tmppath}/%{name}-root

%description
This is the first attempt to create rpm package for xmr cpu miner. This mining software created by fireice-uk. Can be use to mine monero/aeon.

%prep
%setup -q -n %{name}-%{version}

%build
CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{_prefix} --mandir=%{_mandir} --sysconfdir=/etc

make

%install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT

make DESTDIR=$RPM_BUILD_ROOT install
rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/%{name}

%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%doc README AUTHORS COPYING NEWS TODO ChangeLog
%doc doc/*.html
%doc doc/*.jpg
%doc doc/*.css
%config(noreplace) /etc/%{name}.xml
%{_bindir}/xmr-stak-cpu
%{_prefix}/share/xmr-stak-cpu/*
I'm getting the following error.
rpmbuild -ba xmr-stak-cpu.spec:

Code: Select all

 
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.GXkLyE
+ umask 022
+ cd /home/joe/rpmbuild/BUILD
+ cd /home/joe/rpmbuild/BUILD
+ rm -rf xmr-stak-cpu.tgz
+ /usr/bin/gzip -dc /home/joe/rpmbuild/SOURCES/xmr-stak-cpu.tgz
+ /usr/bin/tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd xmr-stak-cpu.tgz
/var/tmp/rpm-tmp.GXkLyE: line 35: cd: xmr-stak-cpu.tgz: No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.GXkLyE (%prep)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.GXkLyE (%prep)
I'm not sure what the problem is. It's saying line 35, but line 35 is empty.
Thanks for reading. Any help is appreciated.

supertight
Posts: 171
Joined: 2017/02/07 21:47:51

Re: 1st time making SPEC File.

Post by supertight » 2018/01/28 20:32:40

I worked past it. It took me a second to figure out what section of the .spec was wrong.
cat xmr-stak-cpu.spec:

Code: Select all

Name:           xmr-stak
Version:        cpu
Release:        0
Summary:        CPU miner monero/aeon.
Group:          miner
License:        GPL
URL:            https://github.com/fireice-uk/xmr-stak-cpu
Vendor:         fireice-uk
Source:         xmr-stak-cpu.tar.gz
Prefix:         %{_prefix}
Packager:       Supertight
BuildRoot:      %{_tmppath}/%{name}-root

%description
This is the first attempt to create rpm package for xmr cpu miner. This mining software created by fireice-uk. Can be use to mine monero/aeon.

%prep
%setup -q -n %{name}-%{version}

%build
CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{_prefix} --mandir=%{_mandir} --sysconfdir=/etc

make

%install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT

make DESTDIR=$RPM_BUILD_ROOT install
rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/%{name}

%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%doc README AUTHORS COPYING NEWS TODO ChangeLog
%doc doc/*.html
%doc doc/*.jpg
%doc doc/*.css
%config(noreplace) /etc/%{name}.xml
%{_bindir}/xmr-stak-cpu
%{_prefix}/share/xmr-stak-cpu/*
Now I'm having problems at line 37
rpmbuild -ba xmr-stak-cpu.spec

Code: Select all

Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.IW8Rwh
+ umask 022
+ cd /home/joe/rpmbuild/BUILD
+ cd /home/joe/rpmbuild/BUILD
+ rm -rf xmr-stak-cpu
+ /usr/bin/gzip -dc /home/joe/rpmbuild/SOURCES/xmr-stak-cpu.tar.gz
+ /usr/bin/tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd xmr-stak-cpu
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ $'\r'
/var/tmp/rpm-tmp.IW8Rwh: line 37: $'\r': command not found
error: Bad exit status from /var/tmp/rpm-tmp.IW8Rwh (%prep)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.IW8Rwh (%prep)
I'm trying to work this error now. Best I can figure, I'm sill not executing %setup section properly.
I'm not sure which line of code. line 37 of xmr-stak-cpu.spec is :

Code: Select all

%doc doc/*.html
I don't think that's the correct line that needs modified. I don't see "$'\r'" in that line.

I'm stumped for now. again.

supertight
Posts: 171
Joined: 2017/02/07 21:47:51

Re: 1st time making SPEC File.

Post by supertight » 2018/01/29 01:52:54

I'm all the way down to the %install section.

I'm getting this after the %build :

Code: Select all

[100%] Built target xmr-stak-cpu
Install the project...
-- Install configuration: "Release"
-- Installing: /home/joe/rpmbuild/BUILDROOT/xmr-stak-cpu-0.x86_64/home/joe/rpmbuild/BUILD/xmr-stak-cpu/bin/config.txt
+ rm -rf /home/joe/rpmbuild/BUILDROOT/xmr-stak-cpu-0.x86_64/usr/share/doc/xmr-stak
+ /usr/lib/rpm/find-debuginfo.sh --strict-build-id -m --run-dwz --dwz-low-mem-die-limit 10000000 --dwz-max-die-limit 110000000 /home/joe/rpmbuild/BUILD/xmr-stak-cpu
/usr/lib/rpm/sepdebugcrcfix: Updated 0 CRC32s, 0 CRC32s did match.
+ '[' '%{buildarch}' = noarch ']'
+ QA_CHECK_RPATHS=1
+ case "${QA_CHECK_RPATHS:-}" in
+ /usr/lib/rpm/check-rpaths
+ /usr/lib/rpm/check-buildroot
+ /usr/lib/rpm/redhat/brp-compress
+ /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/brp-python-bytecompile /usr/bin/python 1
+ /usr/lib/rpm/redhat/brp-python-hardlink
+ /usr/lib/rpm/redhat/brp-java-repack-jars
Processing files: xmr-stak-cpu-0.x86_64
error: Directory not found: /home/joe/rpmbuild/BUILDROOT/xmr-stak-cpu-0.x86_64/home/miner


RPM build errors:
    Directory not found: /home/joe/rpmbuild/BUILDROOT/xmr-stak-cpu-0.x86_64/home/miner
This is what my .spec file has turned into.

Code: Select all

Name:           xmr-stak
Version:        cpu
Release:        0
Summary:        CPU miner monero/aeon.
Group:          miner
License:        GPL
URL:            https://github.com/fireice-uk/xmr-stak-cpu
Vendor:         fireice-uk
Source:         xmr-stak-cpu.tar.gz
Prefix:         %{_prefix}
Packager:       supertight
BuildRoot:      %{_tmppath}/%{name}-root

%description
This is the first attempt to create rpm package for xmr cpu miner. This mining software created by fireice-uk. Can be use to mine monero/aeon.

%prep
%setup -q -n %{name}-%{version}
%build
cmake3 .

%install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT

make DESTDIR=$RPM_BUILD_ROOT install
rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/%{name}

%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT

%files
/home/miner/

supertight
Posts: 171
Joined: 2017/02/07 21:47:51

Re: 1st time making SPEC File.

Post by supertight » 2018/01/29 15:29:39

It's odd how posting here. Even with 0.0% participation from other forum members. Will still help someone work out their problem. It's like self rescue when you're in trouble while scuba diving. Like a wall to bounce stuff off of. Well here we go, starting on day 3.

**Edit**
I hope this somehow helps another noob someday.
Last edited by supertight on 2018/01/29 15:46:10, edited 1 time in total.

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: 1st time making SPEC File.

Post by TrevorH » 2018/01/29 15:37:42

Having "Version: cpu" is most unusual. A version number is normally... a number.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

supertight
Posts: 171
Joined: 2017/02/07 21:47:51

Re: 1st time making SPEC File.

Post by supertight » 2018/01/29 17:19:17

TrevorH wrote:Having "Version: cpu" is most unusual. A version number is normally... a number.
I changed everything around to reflect the proper name and version.
My .spec file now shows as:

Code: Select all

 Name:           xmr-stak-cpu
Version:        0.x86_64
Release:        0
Summary:        CPU miner monero/aeon.
Group:          miner
License:        GPL
URL:            https://github.com/fireice-uk/xmr-stak-cpu
Vendor:         fireice-uk
Source:         xmr-stak-cpu-0.x86_64.tar.gz
Prefix:         %{_prefix}
Packager:       supertight
BuildRoot:      %{_tmppath}/%{name}-root

%description
This is the first attempt to create rpm package for xmr cpu miner. This mining software created by fireice-uk. Can be use to mine monero/aeon.

%prep
%setup -q -n %{name}-%{version}

%build
cmake3 .

%install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT

make DESTDIR=$RPM_BUILD_ROOT install
rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/%{name}

%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT

%files
Now I'm getting this error. Feels like I'm getting close.

Code: Select all

-- Install configuration: "Release"
-- Installing: /home/joe/rpmbuild/BUILDROOT/xmr-stak-cpu-0.x86_64-0.x86_64/home/joe/rpmbuild/BUILD/xmr-stak-cpu-0.x86_64/bin/config.txt
+ rm -rf /home/joe/rpmbuild/BUILDROOT/xmr-stak-cpu-0.x86_64-0.x86_64/usr/share/doc/xmr-stak-cpu
+ /usr/lib/rpm/find-debuginfo.sh --strict-build-id -m --run-dwz --dwz-low-mem-die-limit 10000000 --dwz-max-die-limit 110000000 /home/joe/rpmbuild/BUILD/xmr-stak-cpu-0.x86_64
/usr/lib/rpm/sepdebugcrcfix: Updated 0 CRC32s, 0 CRC32s did match.
+ '[' '%{buildarch}' = noarch ']'
+ QA_CHECK_RPATHS=1
+ case "${QA_CHECK_RPATHS:-}" in
+ /usr/lib/rpm/check-rpaths
+ /usr/lib/rpm/check-buildroot
+ /usr/lib/rpm/redhat/brp-compress
+ /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/brp-python-bytecompile /usr/bin/python 1
+ /usr/lib/rpm/redhat/brp-python-hardlink
+ /usr/lib/rpm/redhat/brp-java-repack-jars
Processing files: xmr-stak-cpu-0.x86_64-0.x86_64
Provides: xmr-stak-cpu = 0.x86_64-0 xmr-stak-cpu(x86-64) = 0.x86_64-0
Requires(rpmlib): rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 rpmlib(CompressedFileNames) <= 3.0.4-1
Processing files: xmr-stak-cpu-debuginfo-0.x86_64-0.x86_64
Provides: xmr-stak-cpu-debuginfo = 0.x86_64-0 xmr-stak-cpu-debuginfo(x86-64) = 0.x86_64-0
Requires(rpmlib): rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 rpmlib(CompressedFileNames) <= 3.0.4-1
Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/joe/rpmbuild/BUILDROOT/xmr-stak-cpu-0.x86_64-0.x86_64
error: Installed (but unpackaged) file(s) found:
   /home/joe/rpmbuild/BUILD/xmr-stak-cpu-0.x86_64/bin/config.txt


RPM build errors:
    Installed (but unpackaged) file(s) found:
   /home/joe/rpmbuild/BUILD/xmr-stak-cpu-0.x86_64/bin/config.txt

supertight
Posts: 171
Joined: 2017/02/07 21:47:51

Re: 1st time making SPEC File.

Post by supertight » 2018/01/29 21:06:48

Some how, rpmbuild is creating this impossibly long directory.
I'm getting this error.

Code: Select all

 Installing: /home/joe/rpmbuild/BUILDROOT/xmr-stak-cpu-0.x86_64-0.x86_64/home/joe/rpmbuild/BUILD/xmr-stak-cpu-0.x86_64/bin/config.txt
+ rm -rf /home/joe/rpmbuild/BUILDROOT/xmr-stak-cpu-0.x86_64-0.x86_64/usr/share/doc/xmr-stak-cpu
+ /usr/lib/rpm/find-debuginfo.sh --strict-build-id -m --run-dwz --dwz-low-mem-die-limit 10000000 --dwz-max-die-limit 110000000 /home/joe/rpmbuild/BUILD/xmr-stak-cpu-0.x86_64
/usr/lib/rpm/sepdebugcrcfix: Updated 0 CRC32s, 0 CRC32s did match.
+ '[' '%{buildarch}' = noarch ']'
+ QA_CHECK_RPATHS=1
+ case "${QA_CHECK_RPATHS:-}" in
+ /usr/lib/rpm/check-rpaths
+ /usr/lib/rpm/check-buildroot
+ /usr/lib/rpm/redhat/brp-compress
+ /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/brp-python-bytecompile /usr/bin/python 1
+ /usr/lib/rpm/redhat/brp-python-hardlink
+ /usr/lib/rpm/redhat/brp-java-repack-jars
Processing files: xmr-stak-cpu-0.x86_64-0.x86_64
error: File not found: /home/joe/rpmbuild/BUILDROOT/xmr-stak-cpu-0.x86_64-0.x86_64/bin/xmr-stak-cpu


RPM build errors:
    File not found: /home/joe/rpmbuild/BUILDROOT/xmr-stak-cpu-0.x86_64-0.x86_64/bin/xmr-stak-cpu
The folder path inside buildroot is crazy long.

Code: Select all

BUILDROOT/xmr-stak-cpu-0.x86_64-0.x86_64/home/joe/rpmbuild/BUILD/xmr-stak-cpu-0.x86_64/bin/
I'm totally lost at this point. I need to rest my eyeballs for a second.

supertight
Posts: 171
Joined: 2017/02/07 21:47:51

Re: 1st time making SPEC File.

Post by supertight » 2018/01/30 15:30:41

I've been kicking around this for a few days. Something is wrong with my build directory or I have some code somewhere that is out of wack. I'm lost, can someone help me out here?

thanks for reading.

User avatar
warron.french
Posts: 616
Joined: 2014/03/27 20:21:58

Re: 1st time making SPEC File.

Post by warron.french » 2018/02/27 21:04:15

supertight,
did you ever get any help at all?

I am learning to write RPMs myself so I have had to revert mostly to Youtube videos and they just don't quite get me to where I need to "land."

I have tons of questions about learning to write RPMs myself for work that I am doing professionally.

I found this url, https://www.youtube.com/watch?v=364Plv6 ... KE&index=1, and it was a considerable amount of useful information. The pace of the video was 'pretty good' but the video skipped quickly past some statements. The poster has not gotten back to me on my questions though.
Thanks,
War

supertight
Posts: 171
Joined: 2017/02/07 21:47:51

Re: 1st time making SPEC File.

Post by supertight » 2018/02/28 04:16:16

warron.french wrote:supertight,
did you ever get any help at all?

I am learning to write RPMs myself so I have had to revert mostly to Youtube videos and they just don't quite get me to where I need to "land."

I have tons of questions about learning to write RPMs myself for work that I am doing professionally.

I found this url, https://www.youtube.com/watch?v=364Plv6 ... KE&index=1, and it was a considerable amount of useful information. The pace of the video was 'pretty good' but the video skipped quickly past some statements. The poster has not gotten back to me on my questions though.
No. Nobody on the forum had any help or advice to offer on this one. I've posted it twice in this forum. I had to move on from it. I already have all my current equipment running, so I figured I would pick it back up when I purchased more equipment and need to setup miner again.

Post Reply