Addition of SPEC File for creation of LTP-DEVEL RPMs on various Architectures for Standalone development of LTP Unit Testcase. Contributed by George Kraft <gk4@us.ibm.com>
diff --git a/Makefile b/Makefile
index 3dbafd8e..4378bda 100644
--- a/Makefile
+++ b/Makefile
@@ -53,6 +53,12 @@
 install: all
 	@$(MAKE) -C testcases install
 	@$(MAKE) -C tools install
+	@$(MAKE) -C lib install
+	@$(MAKE) -C include install
+	@$(MAKE) -C pan install
+	@$(MAKE) -C doc/man1 install
+	@$(MAKE) -C doc/man3 install
+
 	@./IDcheck.sh
 
 libltp.a:
@@ -83,3 +89,8 @@
 	@$(MAKE) -C pan $@
 	@$(MAKE) -C tools $@
 	@$(MAKE) -C testcases $@
+
+package: 
+	rpmbuild -ba ltp-devel.spec
+
+
diff --git a/README.ltp-devel b/README.ltp-devel
new file mode 100644
index 0000000..94a3127
--- /dev/null
+++ b/README.ltp-devel
@@ -0,0 +1,30 @@
+This is a README to describe the ltp-devel.patch functional changes.
+
+"make install" is to build and install:
+
+	/opt/ltp/bin/bump
+	/opt/ltp/bin/pan
+	/opt/ltp/bin/scanner
+	/opt/ltp/include/usctest.h
+	/opt/ltp/include/test.h
+	/opt/ltp/lib/libltp.a
+	/usr/share/pkgconfig/ltp.pc
+	/opt/ltp/share/man/
+
+"make package" is to rpm package what was installed above:
+
+	/usr/src/redhat/RPMS/i386/ltp-devel-1.0-0.0.i386.rpm
+
+For someone wanting to write a standalone test that uses "libltp.a", then
+their Makefile would compile their test program like this:
+
+	test: test.c
+		cc test.c `pkg-config --cflags --libs ltp`
+
+To read manual pages, then the developer would type either:
+
+	man -M /opt/ltp/share/man usctest
+
+	MANPATH=/opt/ltp/share/man man usctest
+
+#EOF
diff --git a/doc/man1/Makefile b/doc/man1/Makefile
new file mode 100644
index 0000000..c46332b
--- /dev/null
+++ b/doc/man1/Makefile
@@ -0,0 +1,12 @@
+
+
+DESTDIR=/opt/ltp
+MANPAGES=bump.1 doio.1 iogen.1 pan.1
+
+all:
+
+install: $(MANPAGES)
+	for i in $(MANPAGES); do \
+		install -D -m 644 $$i $(DESTDIR)/share/man/man1/$$i; \
+	done
+
diff --git a/doc/man3/Makefile b/doc/man3/Makefile
new file mode 100644
index 0000000..d3cc27f
--- /dev/null
+++ b/doc/man3/Makefile
@@ -0,0 +1,15 @@
+
+
+DESTDIR=/opt/ltp
+MANPAGES=forker.3 get_attrib.3 parse_open_flags.3 parse_opts.3 \
+	parse_ranges.3 pattern.3 random_range.3 random_range_seed.3 \
+	rmobj.3 string_to_tokens.3 str_to_bytes.3 tst_res.3 \
+	tst_set_error.3 tst_sig.3 tst_tmpdir.3 usctest.3 write_log.3
+
+all:
+
+install: $(MANPAGES)
+	for i in $(MANPAGES); do \
+		install -D -m 644 $$i $(DESTDIR)/share/man/man3/$$i; \
+	done
+
diff --git a/include/Makefile b/include/Makefile
new file mode 100644
index 0000000..7aa1a8f
--- /dev/null
+++ b/include/Makefile
@@ -0,0 +1,12 @@
+
+
+DESTDIR=/opt/ltp
+HEADERS=usctest.h test.h compiler.h
+
+all:
+
+install: $(HEADERS)
+	for i in $(HEADERS); do \
+		install -D -m 644 $$i $(DESTDIR)/include/$$i; \
+	done
+
diff --git a/lib/Makefile b/lib/Makefile
index ea21544..40d0494 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -1,4 +1,6 @@
 
+DESTDIR=/opt/ltp
+
 ifeq ($(shell uname -s),SunOS)
 CC=gcc -Wall
 endif
@@ -16,7 +18,12 @@
 OBJS=$(patsubst %.c,%.o,$(SRCS))
 
 $(TARGET): $(OBJS)
-	$(AR) -cr $@ $^    
+	$(AR) -cr $@ $^
 
 clean:
 	rm -f $(TARGET) $(OBJS)
+
+install: $(TARGET)
+	install -D $(TARGET) $(DESTDIR)/lib/$(TARGET)
+	install -D ltp.pc /usr/share/pkgconfig/ltp.pc
+
diff --git a/lib/ltp.pc b/lib/ltp.pc
new file mode 100644
index 0000000..6135945
--- /dev/null
+++ b/lib/ltp.pc
@@ -0,0 +1,11 @@
+prefix=/opt/ltp
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: LTP
+Description: Linux Test Project
+Version: 1.0
+Libs: -L${libdir} -lltp
+Cflags: -I${includedir}
+Libs.private: -L${libdir} -lltp 
diff --git a/ltp-devel.spec b/ltp-devel.spec
new file mode 100644
index 0000000..d022e65
--- /dev/null
+++ b/ltp-devel.spec
@@ -0,0 +1,53 @@
+#
+# RPM Package Manager (RPM) spec file for ltp-devel
+#
+Summary: Linux Test Project (LTP) Software Development Kit (SDK)
+Name: ltp-devel
+Version: 1.0
+Release: 0.0
+Prefix: /opt/ltp
+License: GPL
+Group: Development/Libraries
+URL: http://www.linuxtestproject.org
+Vendor: IBM Corp
+Packager: Subrata Modak <subrata.modak@@in.ibm.com>
+AutoReqProv:    0
+Provides:       LTP
+#ExclusiveArch:  i386
+ExclusiveOS:    linux
+%description
+This is a development package of the Linux Test Project (LTP).
+It is intended to be used to build testcases using the provided API.
+%files
+/opt/ltp/include/test.h
+/opt/ltp/include/usctest.h
+/opt/ltp/include/compiler.h
+/opt/ltp/lib/libltp.a
+/usr/share/pkgconfig/ltp.pc
+/opt/ltp/bin/pan
+/opt/ltp/bin/scanner
+/opt/ltp/bin/bump
+/opt/ltp/share/man/man3/tst_tmpdir.3
+/opt/ltp/share/man/man3/random_range_seed.3
+/opt/ltp/share/man/man3/pattern.3
+/opt/ltp/share/man/man3/parse_ranges.3
+/opt/ltp/share/man/man3/usctest.3
+/opt/ltp/share/man/man3/random_range.3
+/opt/ltp/share/man/man3/forker.3
+/opt/ltp/share/man/man3/rmobj.3
+/opt/ltp/share/man/man3/parse_open_flags.3
+/opt/ltp/share/man/man3/tst_res.3
+/opt/ltp/share/man/man3/write_log.3
+/opt/ltp/share/man/man3/str_to_bytes.3
+/opt/ltp/share/man/man3/tst_set_error.3
+/opt/ltp/share/man/man3/parse_opts.3
+/opt/ltp/share/man/man3/string_to_tokens.3
+/opt/ltp/share/man/man3/tst_sig.3
+/opt/ltp/share/man/man3/get_attrib.3
+/opt/ltp/share/man/man1/pan.1
+/opt/ltp/share/man/man1/doio.1
+/opt/ltp/share/man/man1/iogen.1
+/opt/ltp/share/man/man1/bump.1
+# Post-install stuff would go here.
+#EOF
+
diff --git a/pan/Makefile b/pan/Makefile
index 438afe8..5ebd9ef 100644
--- a/pan/Makefile
+++ b/pan/Makefile
@@ -2,6 +2,7 @@
 LOADLIBES += -lm
 LFLAGS += -l
 CFLAGS += -w 
+DESTDIR = /opt/ltp
 
 all: pan bump scanner
 
@@ -14,5 +15,10 @@
 scanner: scan.o scanner.o reporter.o tag_report.o symbol.o splitstr.o debug.o
 
 
+install: pan bump scanner
+	install -D scanner $(DESTDIR)/bin/scanner
+	install -D pan $(DESTDIR)/bin/pan
+	install -D bump $(DESTDIR)/bin/bump
+
 clean:
 	rm -f *.o pan bump scanner