To create an HMAC-SHA1:

$ echo -n "string" | openssl sha1 -hmac "shared_secret"

or

$ echo -n "string" | openssl dgst -sha1 -hmac "shared_secret"