Hello!
I am working with SUSE LINUX tumbleweed and want to create a rpm package
with rpmbuild not as Super User. This is my first time trying to create a rpm.
I created my programs in the past always with an IDE like codelite, codeblocks , QT-Creator or Anjuta.
I started them from the shell, example:
But now i want to create a rpm, but get always errors.
1. Create a program with Anjuta, codelite or codeblocks
2 tar up the sources:
Code:
bohrungen.h
bohrungen.h~
Getvalwelle.cxx
Getvalwelle.cxx~
Getvalwelle.h
etvalwelle.h~
Getvalwelle.o
main.cc
main.cc~
main.o
Makefile
Makefile.am
Makefile.in
passungen
passungen.h
passungen.h~
into passungen-0.1.0.tar.gz
The Makefile is this:
Code:
CC = cc
LD = g++
CFLAGS := -g -O0 -Wall -c
SOURCE := main.cpp Bohrung.cpp Bohrwelle.cpp Getvalwelle.cpp Wellen.cpp
OBJ := main.o Bohrung.o Bohrwelle.o Getvalwelle.o Wellen.o
DEPS := Getvalwelle.h
DEST := itbreiten
BINDIR = /usr/local/bin
DOCDIR = /usr/share/doc/packages/itbreiten
.PHONY: clean
# $(LD) -o $(DEST) main.o
#Befehl Bedeutung
# -c Compile and assemble, but do not link.
#main.o: $(SOURCE)
# $(CC) $(CFLAGS) $(SOURCE)
$(DEST): $(OBJ)
$(LD) -o $(DEST) $(OBJ)
#main.o: main.cpp
# $(CC) -c main.cpp
#bohrposition.o: bohrposition.cpp
# $(CC) -c bohrposition.cpp
#Mit Wildcards können wir Befehle auf eine Gruppe von Dateien anwenden.
#Hier sollen nun alle .c-Dateien zu .o-Dateien kompiliert werden.
#Diese werden mit dem %-Operator gesucht. Der gefundene Dateiname kann #mit $< verwendet werden.
%.o: %.c
$(CC) -c $<
install:
cp itbreiten $(BINDIR)
mkdir $(DOCDIR)
cp README $(DOCDIR)
clean:
rm -f $(OBJ) $(DEST)
3.Then i wrote this spec file named "passungen1.spec":
Code:
Vendor: Josef Wismeth
Summary: calculates systems of fits according to DIN ISO 286-1 and DIN ISO-286-2
Name: itbreiten
Version: 0.1
Release: 1
License: GPL
Group: unsorted
Source: itbreiten0.0.1.tar.gz
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%description
This program allows the user to calculate the measurements of bores and shafts
and their limiting sizes
%prep
%setup -q
%build
make %{?_smp_mflags}
%install
make install
%files
%{_bindir}/itbreiten
4.copied the tar "passungen-0.1.0.tar.gz" to /rpmbuild/SOURCES
5 copied the spec-file into rpmbuild/SPECS
The other directories form rpmbuild BUILD and BUILDROOT were empty.
After that changed in direction /rpmbuild/SPECS and started with rpmbuild -ba passungen1.spec using the terminal.
But i get this error:
Code:
josef@PC192-168-2-100:~/rpmbuild/SPECS> rpmbuild -ba itbreiten1.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.LhQAUg
+ umask 022
+ cd /home/josef/rpmbuild/BUILD
+ cd /home/josef/rpmbuild/BUILD
+ rm -rf itbreiten-0.1
+ /usr/bin/gzip -dc /home/josef/rpmbuild/SOURCES/itbreiten0.0.1.tar.gz
+ /usr/bin/tar -xof -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd itbreiten-0.1
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.mcvIqB
+ umask 022
+ cd /home/josef/rpmbuild/BUILD
+ /usr/bin/rm -rf /home/josef/rpmbuild/BUILDROOT/itbreiten-0.1-1.x86_64
++ dirname /home/josef/rpmbuild/BUILDROOT/itbreiten-0.1-1.x86_64
+ /usr/bin/mkdir -p /home/josef/rpmbuild/BUILDROOT
+ /usr/bin/mkdir /home/josef/rpmbuild/BUILDROOT/itbreiten-0.1-1.x86_64
+ cd itbreiten-0.1
+ make -j4
make: 'itbreiten' is up to date.
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.tJdZZV
+ umask 022
+ cd /home/josef/rpmbuild/BUILD
+ cd itbreiten-0.1
+ make install
cp itbreiten /usr/local/bin
cp: cannot create regular file '/usr/local/bin/itbreiten': Permission denied
make: *** [makefile:39: install] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.tJdZZV (%install)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.tJdZZV (%install)
I hope someone can help me:
He who makes no mistakes makes nothing