+# 1.4.0
+* Haiku対応
+
# 1.3.0
* 英訳の追加 (レミリア・スカーレットさん)
* GNU Make → BSD Make
VERSION != cat main.c | grep "const char \*version" | awk '{print $$5}' | \
sed "s/\"//g" | sed "s/;//"
PREFIX = /usr/local
-
-MANPREFIX = ${PREFIX}/man
-
-.if ${UNAME_S} == "FreeBSD"
-MANPREFIX = ${PREFIX}/share/man
+.if ${UNAME_S} == "Haiku"
+PREFIX = /boot/system
.elif ${UNAME_S} == "Linux"
PREFIX = /usr
+.endif
+
MANPREFIX = ${PREFIX}/share/man
-.elif ${UNAME_S} == "NetBSD"
-PREFIX = /usr/pkg
-MANPREFIX = ${PREFIX}/share/man
+.if ${UNAME_S} == "OpenBSD"
+MANPREFIX = ${PREFIX}/man
+.elif ${UNAME_S} == "Haiku"
+MANPREFIX = ${PREFIX}/documentation/man
+.endif
+
+DATAPREFIX = ${PREFIX}/share
+.if ${UNAME_S} == "Haiku"
+DATAPREFIX = ${PREFIX}/data
.endif
CC = cc
chmod 644 ${DESTDIR}${MANPREFIX}/man1/${NAME}-jp.1
install-zsh:
- cp sp-completion.zsh ${DESTDIR}${PREFIX}/share/zsh/site-functions/_sp
+ cp sp-completion.zsh ${DESTDIR}${DATAPREFIX}/zsh/site-functions/_sp
uninstall:
rm -rf ${DESTDIR}${PREFIX}/bin/${NAME}
rm -rf ${DESTDIR}${MANPREFIX}/man1/${NAME}-en.1
rm -rf ${DESTDIR}${MANPREFIX}/man1/${NAME}-jp.1
- rm -rf ${DESTDIR}${PREFIX}/share/zsh/site-functions/_sp
+ rm -rf ${DESTDIR}${DATAPREFIX}/zsh/site-functions/_sp
.PHONY: all clean dist install install-zsh uninstall
doas make install-zsh
```
+### Haiku
+```sh
+pkgman install bmake libassuan libassuan_devel gpgme gpgme_devel gnupg llvm18_clang
+bmake
+bmake install
+bmake install-zsh
+```
+
## 初期設定 | Initial setup
「gpg -k」でGPG鍵IDを確認して、「sp -i [GPG ID]」を実行して下さい。
Confirm your GPG key ID with "gpg -k", and run "sp -i [GPG ID]".
return NULL;
}
+#if defined(__HAIKU__)
+ char *basedir = "/config/settings/sp/"
+#else
char *basedir = "/.local/share/sp/";
+#endif
size_t fullPathLen;
char *fullPath;
if (arg != NULL) {
return;
}
+#if defined(__HAIKU__)
+ char *basedir = "/config/settings/sp/"
+#else
char *basedir = "/.local/share/sp/";
+#endif
char *ext = ".gpg";
char pass[256];
return -1;
}
+#if defined(__HAIKU__)
+ char *basedir = "/config/settings/sp/"
+#else
char *basedir = "/.local/share/sp/";
+#endif
char *ext = ".gpg";
int alllen = snprintf(NULL, 0, "%s%s%s%s", homedir, basedir, file, ext) + 1;
return;
}
+#if defined(__HAIKU)
+ char *basedir = "/config/settings/sp/"
+#else
char *basedir = "/.local/share/sp/";
+#endif
char dirpath[256];
snprintf(dirpath, sizeof(dirpath), "%s%s", homedir, basedir);
return secret_decoded;
}
+#if defined(__HAIKU__)
+uint64_t htobe64(uint64_t counter) {
+ uint64_t res = 0;
+ uint8_t *dest = (uint8_t *)&res;
+ uint8_t *src = (uint8_t *)&counter;
+
+ dest[0] = src[7];
+ dest[1] = src[6];
+ dest[2] = src[5];
+ dest[3] = src[4];
+ dest[4] = src[3];
+ dest[5] = src[2];
+ dest[6] = src[1];
+ dest[7] = src[0];
+
+ return res;
+}
+#endif
+
uint32_t generate_totp(const char *secret, uint64_t counter) {
counter = htobe64(counter);
return NULL;
}
+#if defined(__HAIKU__)
+ char *basedir = "/config/settings/sp/"
+#else
char *basedir = "/.local/share/sp/";
+#endif
char *ext = ".gpg";
int alllen = snprintf(NULL, 0, "%s%s%s%s", homedir, basedir, file, ext) + 1;
char *gpgpath = malloc(alllen);
return;
}
+#if defined(__HAIKU__)
+ char *basedir = "/config/settings/sp/"
+#else
char* basedir = "/.local/share/sp/";
+#endif
char* ext = ".gpg";
int alllen = snprintf(NULL, 0, "%s%s%s%s", homedir, basedir, file, ext) + 1;
char* gpgpath = malloc(alllen);