--- /dev/null
+--- bglibs-1.005/installer.c.orig Wed Dec 18 00:26:02 2002
++++ bglibs-1.005/installer.c Sun Jan 19 11:25:34 2003
+@@ -29,6 +29,10 @@
+ static void setmodes(const char* filename,
+ unsigned uid, unsigned gid, unsigned mode)
+ {
++ if (uid == (unsigned)-1)
++ uid = getuid();
++ if (gid == (unsigned)-1)
++ gid = getgid();
+ if (chown(filename, uid, gid) == -1)
+ diefsys("Could not set owner or group for", filename);
+ if (chmod(filename, mode) == -1)
--- /dev/null
+Summary: Bruce Guenter's Libraries Collection
+Summary(pl): Zestaw bibliotek Bruce'a Guentera
+Name: bglibs
+Version: 1.005
+Release: 1
+License: GPL
+Group: Development/Libraries
+Source0: http://untroubled.org/bglibs/%{name}-%{version}.tar.gz
+Patch0: %{name}-nonroot.patch
+URL: http://untroubled.org/bglibs/
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+# it cannot be installed in /usr/{include,lib} because of filename collisions
+%define _prefix /usr/lib/bglibs
+
+%description
+Bruce Guenter's Libraries Collection.
+
+%description -l pl
+Zestaw bibliotek Bruce'a Guentera.
+
+%prep
+%setup -q
+%patch -p1
+
+%build
+echo '%{__cc} %{rpmcflags} -Wall' > conf-cc
+echo '%{_prefix}' > conf-home
+echo '%{__cc} %{rpmldflags}' > conf-ld
+
+%{__make}
+
+rm -f conf_home.c insthier.o installer
+echo "$RPM_BUILD_ROOT%{_prefix}" > conf-home
+%{__make} installer
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT%{_prefix}
+
+./installer
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc ChangeLog NEWS README TODO
+%dir %{_prefix}
+%{_prefix}/include
+%{_prefix}/lib